2007-02-05 16:53:48 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Generate GPG signatures on a PuTTY release/snapshot directory as
|
|
|
|
# delivered by Buildscr.
|
|
|
|
|
2015-09-02 20:30:10 +03:00
|
|
|
# Usage: sh sign.sh [-r] <builddir>
|
|
|
|
# e.g. sh sign.sh putty (probably in the build.out directory)
|
|
|
|
# or sh sign.sh -r 0.60 (-r means use the release keys)
|
2007-02-05 16:53:48 +03:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2018-08-25 16:36:25 +03:00
|
|
|
keyname=38BA7229B7588FD1
|
2017-07-03 09:38:20 +03:00
|
|
|
preliminary=false
|
2015-09-02 20:30:10 +03:00
|
|
|
|
2017-07-03 09:38:20 +03:00
|
|
|
while :; do
|
|
|
|
case "$1" in
|
|
|
|
-r)
|
|
|
|
shift
|
2018-08-25 16:36:25 +03:00
|
|
|
keyname=6289A25F4AE8DA82
|
2017-07-03 09:38:20 +03:00
|
|
|
;;
|
|
|
|
-p)
|
|
|
|
shift
|
|
|
|
preliminary=true
|
|
|
|
;;
|
|
|
|
-*)
|
|
|
|
echo "Unknown option '$1'" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2015-09-02 20:30:10 +03:00
|
|
|
|
2007-02-05 16:53:48 +03:00
|
|
|
sign() {
|
|
|
|
# Check for the prior existence of the signature, so we can
|
|
|
|
# re-run this script if it encounters an error part way
|
|
|
|
# through.
|
2015-09-02 20:30:10 +03:00
|
|
|
echo "----- Signing $2 with key '$keyname'"
|
2007-02-05 16:53:48 +03:00
|
|
|
test -f "$3" || \
|
|
|
|
gpg --load-extension=idea "$1" -u "$keyname" -o "$3" "$2"
|
|
|
|
}
|
|
|
|
|
|
|
|
cd "$1"
|
2015-09-02 20:30:10 +03:00
|
|
|
echo "===== Signing with key '$keyname'"
|
2017-07-03 09:38:20 +03:00
|
|
|
if $preliminary; then
|
|
|
|
sign --clearsign sha512sums ../sha512sums-preliminary.gpg
|
|
|
|
else
|
|
|
|
for i in putty*src.zip putty*.tar.gz \
|
|
|
|
w32/*.exe w32/*.zip w32/*.msi \
|
|
|
|
w64/*.exe w64/*.zip w64/*.msi \
|
|
|
|
w32old/*.exe w32old/*.zip; do
|
|
|
|
sign --detach-sign "$i" "$i.gpg"
|
|
|
|
done
|
|
|
|
for i in md5sums sha1sums sha256sums sha512sums; do
|
|
|
|
sign --clearsign "$i" "$i.gpg"
|
|
|
|
done
|
|
|
|
fi
|