X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=scripts%2Fdebian%2Fbuildd-remove-keys;h=3591785d6c028769b169a9b22f1f81b3b1f5e2a9;hb=d4ede014e6f4df2f3ea798e610df8d1dbfbf2843;hp=0ea4c23dc33afebf6031e7b9d15811a84470e0e7;hpb=3f673e29a7eccfbf1ef4f162dfe5bc40af84cd81;p=dak.git diff --git a/scripts/debian/buildd-remove-keys b/scripts/debian/buildd-remove-keys index 0ea4c23d..3591785d 100755 --- a/scripts/debian/buildd-remove-keys +++ b/scripts/debian/buildd-remove-keys @@ -51,13 +51,13 @@ function cleanup() { done exit $ERRVAL } -trap cleanup ERR EXIT TERM HUP INT QUIT base="${base}/scripts/builddkeyrings" INCOMING="${base}/incoming" ERRORS="${base}/errors" ADMINS="${base}/adminkeys.gpg" REMOVED="${base}/removed-buildd-keys.gpg" +STAMPFILE="${base}/updatedkeyring" # Default options for our gpg calls DEFGPGOPT="--no-default-keyring --batch --no-tty --no-options --exit-on-status-write-error --no-greeting" @@ -67,11 +67,22 @@ if ! [ -d "${INCOMING}" ]; then exit 1 fi +cd "${INCOMING}" +KEYS=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.del | sed -e "s,./,," | xargs) +if [ -z "${KEYS}" ]; then + exit 0 +fi + +trap cleanup ERR EXIT TERM HUP INT QUIT + +# Tell prepare-dir that there is an update and it can run +touch "${STAMPFILE}" + # Whenever something goes wrong, its put in there. mkdir -p "${ERRORS}" # We process all new files in our incoming directory -for file in $(ls -1 ${INCOMING}/*.del ); do +for file in ${KEYS}; do file=${file##*/} # First we want to see if we recognize the filename. The buildd people have # to follow a certain schema: