From: Joerg Jaspert <joerg@debian.org>
Date: Sat, 24 Mar 2012 17:04:14 +0000 (+0100)
Subject: buildd add keys
X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=5f2e8ff9f4ac151cf568900629972eca34a003e5;p=dak.git

buildd add keys

ignore the gpg error message, redirecting to dev/null. can appear if we have a new arch/buildd, then its a key-not-found complaint, which we dont care about. and we also care nothing about any other error it might give us here, so off it goes

also log if we have too many keys

Signed-off-by: Joerg Jaspert <joerg@debian.org>
---

diff --git a/scripts/debian/buildd-add-keys b/scripts/debian/buildd-add-keys
index 619a514f..b141cc86 100755
--- a/scripts/debian/buildd-add-keys
+++ b/scripts/debian/buildd-add-keys
@@ -274,8 +274,9 @@ for file in ${KEYS}; do
     # We need to check for the amount of keys
     ARCHKEYRING="${base}/${ARCH}/keyring.gpg"
 
-    KEYNO=$(gpg ${DEFGPGOPT} --keyring "${ARCHKEYRING}" --with-colons --list-keys "buildd_${ARCH}-${BUILDD}@buildd.debian.org" | grep -c '^pub:' || /bin/true )
+    KEYNO=$(gpg ${DEFGPGOPT} --keyring "${ARCHKEYRING}" --with-colons --list-keys "buildd_${ARCH}-${BUILDD}@buildd.debian.org" 2>/dev/null | grep -c '^pub:' || /bin/true )
     if [ ${KEYNO} -gt 2 ]; then
+        log "Too many keys for ${ARCH} buildd ${BUILDD}"
         DATE=$(date -Is)
         mv "${INCOMING}/${file}" "${ERRORS}/toomany.${file}.${DATE}"
         mv "${GPGSTATUS}" "${ERRORS}/toomany.${file}.gpgstatus.${DATE}"