X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=scripts%2Fdebian%2Fbuildd-add-keys;h=4ded0f342ea0cf31c4bdd1b19fb123a625db99e5;hb=5ec8ebfaf6690e95ce7a7ffdcd6c298d5dceac90;hp=ddb56a42d6c446b97c4bde3192123e5d787e3621;hpb=2503c5721f91672e41e4af43aec4106c677db453;p=dak.git diff --git a/scripts/debian/buildd-add-keys b/scripts/debian/buildd-add-keys index ddb56a42..4ded0f34 100755 --- a/scripts/debian/buildd-add-keys +++ b/scripts/debian/buildd-add-keys @@ -74,8 +74,8 @@ for file in $(ls -1 ${INCOMING}/*.key); do file=${file##*/} # First we want to see if we recognize the filename. The buildd people have # to follow a certain schema: - # architecture_builddname.YEAR-MONTH-DAY_HOUR:MINUTE.key - if [[ $file =~ (.*)_(.*).([0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{2}:[0-9]{2}).key ]]; then + # architecture_builddname.YEAR-MONTH-DAY_HOURMINUTE.key + if [[ $file =~ (.*)_(.*).([0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{2}[0-9]{2}).key ]]; then ARCH=${BASH_REMATCH[1]} BUILDD=${BASH_REMATCH[2]} # Right now timestamp is unused @@ -221,8 +221,9 @@ for file in $(ls -1 ${INCOMING}/*.key); do # rollover works. 3 won't, they have to rm one first # We need to check for the amount of keys ARCHKEYRING="${base}/${ARCH}/keyring.gpg" + trap - ERR EXIT TERM HUP INT QUIT - KEYNO=$(gpg ${DEFGPGOPT} --keyring "${ARCHKEYRING}" --with-colons --list-keys "buildd_${ARCH}-${BUILDD}@buildd.debian.org" | grep -c '^pub:') + KEYNO=$(gpg ${DEFGPGOPT} --keyring "${ARCHKEYRING}" --with-colons --list-keys "buildd_${ARCH}-${BUILDD}@buildd.debian.org" | grep -c '^pub:' || /bin/true ) if [ ${KEYNO} -gt 2 ]; then DATE=$(date -Is) mv "${INCOMING}/${file}" "${ERRORS}/toomany.${file}.${DATE}"