fixup and improve script, update keyring
authorIan Kelling <iank@fsf.org>
Wed, 17 Oct 2018 02:07:28 +0000 (22:07 -0400)
committerIan Kelling <iank@fsf.org>
Wed, 17 Oct 2018 02:07:28 +0000 (22:07 -0400)
fsf-keyring.gpg
fsf-keyring.sh

index 59d1601789c72693b607ba6d7dd99cdaf2ccb53d..64e6cc5a612f07821bd5a00a4ab4e4211df619ee 100644 (file)
Binary files a/fsf-keyring.gpg and b/fsf-keyring.gpg differ
index 1593f190b0d6d84e57c1aec9cc465aca62464a66..36939235040b60b3584f3ac7739d9861b5213c6b 100755 (executable)
@@ -1,16 +1,35 @@
-#!/bin/bash
+#!/bin/bash -l
 
 set -e
 set -x
 
-#gpg --keyserver pgp.mit.edu --refresh-keys
+refresh-gpg-key() {
+
+  key=$1
+
+  error=999
+  for keyserver in pgp.mit.edu pool.sks-keyservers.net keyring.debian.org; do
+    set +e
+    cmd="gpg --keyserver $keyserver --recv-keys $key"
+    # keyservers are not very reliable, so retry
+    for x in {1..3}; do
+      $cmd &>/dev/null
+      ret=$?
+      if (( ret == 0 )); then break; fi
+      sleep 1
+    done
+    set -e
+    error=$(( ret < error ? ret : error )) # use lowest return
+  done
+
+  return $error
+}
 
 KEYS+="67819B343B2AB70DED9320872C6464AF2A8E4C02 " #rms
 KEYS+="A4626CBAFF376039D2D7554497BA9CE761A0963B " #johns
 KEYS+="759C0A4A39A02A079712FB5061B826E87A80C8D6 " #johnh
 KEYS+="CEA951DB865D0D257BB0A14DCEB69E6F9B36C195 " #andrew
 KEYS+="13A0851D6307FC54FCCB81BA2C1008316F3E89B7 " #donald
-KEYS+="6F460BCE44EC76B3A80289E47A95AF6BDAF44061 " #georgia
 KEYS+="EF6643D6E1F115D1A9B7D59C92D16583E1E7C532 " #jeanne
 KEYS+="04C45B4E3AF05E9EB140FD148B10E9C6407BD6E1 " #matt
 KEYS+="05EF1D2FFE61747D1FC827C37FAC7D26472F4409 " #ruben
@@ -24,9 +43,12 @@ KEYS+="2C31130BF7D5A459AFF2A3F3C9DFFE4A33AA52D9 " #knauth
 rm -f /tmp/keys.asc ./fsf-keyring.gpg
 
 for KEY in $KEYS ; do
-    echo $KEY
-    gpg --export --armor $KEY >> /tmp/keys.asc
+  refresh-gpg-key $KEY
+  gpg --export --armor $KEY >> /tmp/keys.asc
 done
 
-gpg --no-default-keyring --keyring ./fsf-keyring.gpg --import /tmp/keys.asc
-gpg --sign -a ./fsf-keyring.gpg
+# TODO: this doesn't work with gpg2. i dunno what the equivalent is, likely just exporting
+# all the keys.
+gpg --trust-model always --no-default-keyring --keyring ./fsf-keyring.gpg --import /tmp/keys.asc
+gpg --sign ./fsf-keyring.gpg
+mv fsf-keyring.gpg.gpg fsf-keyring.gpg