1
0
Files
electrum/contrib/build-wine/unsign.sh
f321x eba21231c9 fix: build-wine/unsign.sh fail if osslsigncode is missing
If osslsigncode is missing `build-wine/unsign.sh` fails silently with
status code 0 causing the `release.sh` script to interpret the result as
valid and skipping the actual comparison of the windows binaries.
2025-06-16 14:50:22 +02:00

48 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# exit if command fails
set -e
PROJECT_ROOT="$(dirname "$(readlink -e "$0")")/../.."
CONTRIB="$PROJECT_ROOT/contrib"
here=$(dirname "$0")
test -n "$here" -a -d "$here" || exit
cd $here
if ! which osslsigncode > /dev/null 2>&1; then
echo "Please install osslsigncode"
exit 1
fi
rm -rf signed/stripped
mkdir -p signed >/dev/null 2>&1
mkdir -p signed/stripped >/dev/null 2>&1
version=$("$CONTRIB"/print_electrum_version.py)
echo "Found $(ls dist/*.exe | wc -w) files to verify."
for mine in $(ls dist/*.exe); do
echo "---------------"
f="$(basename $mine)"
if test -f "signed/$f"; then
echo "Found file at signed/$f"
else
echo "Downloading https://download.electrum.org/$version/$f"
wget -q "https://download.electrum.org/$version/$f" -O "signed/$f"
fi
out="signed/stripped/$f"
# Remove PE signature from signed binary
osslsigncode remove-signature -in "signed/$f" -out "$out" > /dev/null 2>&1
chmod +x "$out"
if cmp -s "$out" "$mine"; then
echo "Success: $f"
#gpg --sign --armor --detach signed/$f
else
echo "Failure: $f"
exit 1
fi
done
exit 0