X-Git-Url: https://git.decadent.org.uk/gitweb/?p=dak.git;a=blobdiff_plain;f=scripts%2Fdebian%2Fbuildd-add-keys;h=619a514f07458d432b418700574784f4774bdf8e;hp=61cd154c27127fea3a9b3869f8693bb7528ff5a6;hb=dd80b169287a128cd9e3b833852fbf68106385b5;hpb=b60394c7d9054748972aaf019398c9837d712b99 diff --git a/scripts/debian/buildd-add-keys b/scripts/debian/buildd-add-keys index 61cd154c..619a514f 100755 --- a/scripts/debian/buildd-add-keys +++ b/scripts/debian/buildd-add-keys @@ -176,7 +176,17 @@ for file in ${KEYS}; do TEMPKEYDATA=$(mktemp -p "${TMPDIR}" BDKEYS.XXXXXX) - gpg ${DEFGPGOPT} --with-colons "${GPGOUTF}" > "${TEMPKEYDATA}" + # We also need to ensure this works, otherwise manually mangled files can break us here + if ! gpg ${DEFGPGOPT} --with-colons "${GPGOUTF}" > "${TEMPKEYDATA}"; then + log "For some reason we could validate the sig but failed on getting key details" + DATE=$(date -Is) + mv "${INCOMING}/${file}" "${ERRORS}/badsig.${file}.${DATE}" + mv "${GPGSTATUS}" "${ERRORS}/badsig.${file}.gpgstatus.${DATE}" + mv "${GPGLOGS}" "${ERRORS}/badsig.${file}.gpglogs.${DATE}" + rm -f "${GPGOUTF}" + rm -f "${TMPKEYDATA}" + continue + fi # Read in the TEMPKEYDATAFILE, but avoid using a subshell like a # while read line otherwise would do