From dd65a7b529b4ed48df627c6121a6160f963b21e4 Mon Sep 17 00:00:00 2001 From: Michael Altfield Date: Wed, 6 Mar 2024 23:14:11 -0500 Subject: [PATCH] fix macos builds * added --location flag to curl so it follows 302 redirects (otherwise it results in an empty file and you get gpg errors) maltfield@host buskill-app % build/mac/buildDmg.sh ... + tmpDir=/var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2 + pushd /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2 /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2 ~/sandbox/buskill-app + file_url=https://github.com/vsajip/python-gnupg/releases/download/0.5.2/python_gnupg-0.5.2-py2.py3-none-any.whl + signature_url=https://github.com/vsajip/python-gnupg/releases/download/0.5.2/python_gnupg-0.5.2-py2.py3-none-any.whl.asc + curl --remote-name https://github.com/vsajip/python-gnupg/releases/download/0.5.2/python_gnupg-0.5.2-py2.py3-none-any.whl % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 ++ ls -1 ++ head -n1 + filename=python_gnupg-0.5.2-py2.py3-none-any.whl + curl --remote-name https://github.com/vsajip/python-gnupg/releases/download/0.5.2/python_gnupg-0.5.2-py2.py3-none-any.whl.asc % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 + mkdir gnupg + chmod 0700 gnupg + popd ~/sandbox/buskill-app + gpg --homedir /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg --import build/deps/python-gnupg.asc gpg: keybox '/var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg/pubring.kbx' created gpg: /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg/trustdb.gpg: trustdb created gpg: key 9147B477339A9B86: public key "Vinay Sajip (CODE SIGNING KEY) " imported gpg: Total number processed: 1 gpg: imported: 1 + gpgv --homedir /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg --keyring /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg/pubring.kbx /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/python_gnupg-0.5.2-py2.py3-none-any.whl.asc /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/python_gnupg-0.5.2-py2.py3-none-any.whl gpgv: can't allocate lock for '/var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg/pubring.kbx' gpgv: verify signatures failed: Unknown system error + [[ 2 -ne 0 ]] + echo 'ERROR: Invalid PGP signature!' ERROR: Invalid PGP signature! + exit 1 maltfield@host buskill-app % ... maltfield@host tmp.qc6P8CF2 % du -sh * 12K gnupg 0B python_gnupg-0.5.2-py2.py3-none-any.whl 0B python_gnupg-0.5.2-py2.py3-none-any.whl.asc maltfield@host tmp.qc6P8CF2 % * also switched source of libusb1 to GitHub --- build/mac/buildDmg.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/build/mac/buildDmg.sh b/build/mac/buildDmg.sh index 9afcd4c4..031871df 100755 --- a/build/mac/buildDmg.sh +++ b/build/mac/buildDmg.sh @@ -201,9 +201,9 @@ signature_url='https://github.com/vsajip/python-gnupg/releases/download/0.5.2/py #wget "${signature_url}" # switching from wget to curl to avoid "dyld Library not loaded" brew issues # * https://github.com/BusKill/buskill-app/issues/70 -curl --remote-name "${file_url}" +curl --location --remote-name "${file_url}" filename="`ls -1 | head -n1`" -curl --remote-name "${signature_url}" +curl --location --remote-name "${signature_url}" mkdir gnupg chmod 0700 gnupg @@ -226,12 +226,20 @@ rm -rf "${tmpDir}" # * https://github.com/BusKill/buskill-app/issues/17 tmpDir="`mktemp -d`" || exit 1 pushd "${tmpDir}" -${PIP_PATH} download libusb1 -filename="`ls -1 | head -n1`" -signature_url=`curl -s https://pypi.org/simple/libusb1/ | grep -oE "https://.*${filename}#" | sed 's/#/.asc/'` + +# changing to use the files on GitHub, since the sigs are no longer available +# from PyPI +# * https://github.com/BusKill/buskill-app/issues/78 +# TODO: update this to query the GitHub API and grab the latest release +#${PIP_PATH} download libusb1 +file_url='https://github.com/vpelletier/python-libusb1/releases/download/3.1.0/libusb1-3.1.0-py3-none-any.whl' +signature_url='https://github.com/vpelletier/python-libusb1/releases/download/3.1.0/libusb1-3.1.0-py3-none-any.whl.asc' + #wget "${signature_url}" # switching from wget to curl to avoid "dyld Library not loaded" brew issues # * https://github.com/BusKill/buskill-app/issues/70 +curl --location --remote-name "${file_url}" +filename="`ls -1 | head -n1`" curl --remote-name "${signature_url}" mkdir gnupg