1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-09-20 14:51:42 +02:00

build-aux: Add cleanup to gpg-authcode-sign.sh

* tools/gpg-authcode-sign.sh (cleanup): New.

--
When using osslsigncode it does not delete the
output file on error. Errors or cancels there
can happen easily with either timestamp problems
or a wrong password.
Additionally, if an output file exists, osslsigncode
does not write a good error message but shows
some exception.
This commit is contained in:
Andre Heinecke 2024-08-13 12:30:52 +02:00
parent d80345244c
commit 536fc8d33d
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -183,6 +183,16 @@ if [ ! -f $autogenrc ]; then
exit 1
fi
# Define the cleanup routine for osslsigncode
cleanup() {
if [[ -n "$outname" && -f "${outname}.tmp" ]]; then
echo "Cleaning up: Removing ${outname}.tmp"
rm -f "${outname}.tmp"
fi
}
# Trap any error to call the cleanup routine
trap cleanup ERR SIGINT SIGTERM
for v in AUTHENTICODE_SIGNHOST AUTHENTICODE_TOOL AUTHENTICODE_TSURL \
AUTHENTICODE_KEY AUTHENTICODE_CERTS VERSION_SIGNKEY \