sign.sh 922 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. # Generate GPG signatures on a PuTTY release/snapshot directory as
  3. # delivered by Buildscr.
  4. # Usage: sh sign.sh [-r] <builddir>
  5. # e.g. sh sign.sh putty (probably in the build.out directory)
  6. # or sh sign.sh -r 0.60 (-r means use the release keys)
  7. set -e
  8. keyname=EEF20295D15F7E8A
  9. if test "x$1" = "x-r"; then
  10. shift
  11. keyname=9DFE2648B43434E4
  12. fi
  13. sign() {
  14. # Check for the prior existence of the signature, so we can
  15. # re-run this script if it encounters an error part way
  16. # through.
  17. echo "----- Signing $2 with key '$keyname'"
  18. test -f "$3" || \
  19. gpg --load-extension=idea "$1" -u "$keyname" -o "$3" "$2"
  20. }
  21. cd "$1"
  22. echo "===== Signing with key '$keyname'"
  23. for i in putty*src.zip putty*.tar.gz x86/*.exe x86/*.zip x86/*.msi; do
  24. sign --detach-sign "$i" "$i.gpg"
  25. done
  26. for i in md5sums sha1sums sha256sums sha512sums; do
  27. sign --clearsign "$i" "$i.gpg"
  28. done