diff options
author | Andre Heinecke <aheinecke@gnupg.org> | 2024-08-13 12:30:52 +0200 |
---|---|---|
committer | Andre Heinecke <aheinecke@gnupg.org> | 2024-08-15 22:44:56 +0200 |
commit | 536fc8d33db571108459493d1881cdfc8371d3cc (patch) | |
tree | 311887f68ae88d93be522e5eb351cad80ad19150 /tools | |
parent | speedo,w32: Install ntbtls as a library (diff) | |
download | gnupg2-536fc8d33db571108459493d1881cdfc8371d3cc.tar.xz gnupg2-536fc8d33db571108459493d1881cdfc8371d3cc.zip |
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.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/gpg-authcode-sign.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/gpg-authcode-sign.sh b/tools/gpg-authcode-sign.sh index 171e691f5..6e623ed06 100755 --- a/tools/gpg-authcode-sign.sh +++ b/tools/gpg-authcode-sign.sh @@ -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 \ |