contrib/build-wine/unsign.sh: small improvements/fixes
- follow-up prev: CONTRIB was not defined - rm folder signed/stripped if already exists (otherwise script early-exited silently) - quote paths to guard against whitespace shenanigans
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
PROJECT_ROOT="$(dirname "$(readlink -e "$0")")/../.."
|
||||||
|
CONTRIB="$PROJECT_ROOT/contrib"
|
||||||
here=$(dirname "$0")
|
here=$(dirname "$0")
|
||||||
test -n "$here" -a -d "$here" || exit
|
test -n "$here" -a -d "$here" || exit
|
||||||
cd $here
|
cd $here
|
||||||
@@ -11,6 +14,7 @@ fi
|
|||||||
# exit if command fails
|
# exit if command fails
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
rm -rf signed/stripped
|
||||||
mkdir -p signed >/dev/null 2>&1
|
mkdir -p signed >/dev/null 2>&1
|
||||||
mkdir -p signed/stripped >/dev/null 2>&1
|
mkdir -p signed/stripped >/dev/null 2>&1
|
||||||
|
|
||||||
@@ -20,18 +24,18 @@ echo "Found $(ls dist/*.exe | wc -w) files to verify."
|
|||||||
|
|
||||||
for mine in $(ls dist/*.exe); do
|
for mine in $(ls dist/*.exe); do
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
f=$(basename $mine)
|
f="$(basename $mine)"
|
||||||
if test -f signed/$f; then
|
if test -f "signed/$f"; then
|
||||||
echo "Found file at signed/$f"
|
echo "Found file at signed/$f"
|
||||||
else
|
else
|
||||||
echo "Downloading https://download.electrum.org/$version/$f"
|
echo "Downloading https://download.electrum.org/$version/$f"
|
||||||
wget -q https://download.electrum.org/$version/$f -O signed/$f
|
wget -q "https://download.electrum.org/$version/$f" -O "signed/$f"
|
||||||
fi
|
fi
|
||||||
out="signed/stripped/$f"
|
out="signed/stripped/$f"
|
||||||
# Remove PE signature from signed binary
|
# Remove PE signature from signed binary
|
||||||
osslsigncode remove-signature -in signed/$f -out $out > /dev/null 2>&1
|
osslsigncode remove-signature -in "signed/$f" -out "$out" > /dev/null 2>&1
|
||||||
chmod +x $out
|
chmod +x "$out"
|
||||||
if cmp -s $out $mine; then
|
if cmp -s "$out" "$mine"; then
|
||||||
echo "Success: $f"
|
echo "Success: $f"
|
||||||
#gpg --sign --armor --detach signed/$f
|
#gpg --sign --armor --detach signed/$f
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user