From: Daniele Varrazzo Date: Thu, 11 Nov 2021 22:12:16 +0000 (+0100) Subject: strip_wheel: don't require to install the zip system package X-Git-Tag: 3.0.4~2^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5dce970bc91638a8495931335225522821580026;p=thirdparty%2Fpsycopg.git strip_wheel: don't require to install the zip system package Use the zipfile module command line. --- diff --git a/tools/build/strip_wheel.sh b/tools/build/strip_wheel.sh index fc129472b..3710ef1ca 100755 --- a/tools/build/strip_wheel.sh +++ b/tools/build/strip_wheel.sh @@ -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 - diff --git a/tools/build/wheel_linux_before_all.sh b/tools/build/wheel_linux_before_all.sh index cd5ee908b..a67024627 100755 --- a/tools/build/wheel_linux_before_all.sh +++ b/tools/build/wheel_linux_before_all.sh @@ -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