]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
strip_wheel: don't require to install the zip system package
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 11 Nov 2021 22:12:16 +0000 (23:12 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 14 Nov 2021 19:52:03 +0000 (20:52 +0100)
Use the zipfile module command line.

tools/build/strip_wheel.sh
tools/build/wheel_linux_before_all.sh

index fc129472bba7b41acf68084f18a94b940af72613..3710ef1ca4f288ceb537b1e252474f2418dd3d62 100755 (executable)
@@ -21,6 +21,14 @@ shift
 tmpdir=$(mktemp -d)
 trap "rm -r ${tmpdir}" EXIT
 
-unzip -d "${tmpdir}" "${wheel}"
-find "${tmpdir}" -name \*.so | xargs strip "$@"
-(cd "${tmpdir}" && zip -fr ${wheel} *)
+cd "${tmpdir}"
+python -m zipfile -e "${wheel}" .
+
+# Busybox doesn't have "find -ls"
+find . -name \*.so | xargs ls -l
+find . -name \*.so -exec strip "$@" {} \;
+find . -name \*.so | xargs ls -l
+
+python -m zipfile -c ${wheel} *
+
+cd -
index cd5ee908b0425fec94cbb2ccdd5d319ea4e047cb..a670246273ef0d3afa0664e1cd100751333a2e54 100755 (executable)
@@ -11,10 +11,10 @@ set -x
 # Install PostgreSQL development files.
 case "$ID" in
     alpine)
-        # zip is required by strip_wheel.sh
         # tzdata is required for datetime tests.
-        apk add --no-cache postgresql-dev tzdata zip
+        apk add --no-cache postgresql-dev tzdata
         ;;
+
     debian)
         # Note that the pgdg doesn't have an aarch64 repository so wheels are
         # build with the libpq packaged with Debian 9, which is 9.6.
@@ -28,9 +28,9 @@ case "$ID" in
                 > /etc/apt/trusted.gpg.d/postgresql.asc
         fi
         apt-get update
-        # zip is required by strip_wheel.sh
-        apt-get -y install libpq-dev zip
+        apt-get -y install libpq-dev
         ;;
+
     *)
         echo "Unexpected Linux distribution: '$ID'" >&2
         exit 1