summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndre Heinecke <aheinecke@gnupg.org>2024-08-13 12:30:52 +0200
committerAndre Heinecke <aheinecke@gnupg.org>2024-08-15 22:44:56 +0200
commit536fc8d33db571108459493d1881cdfc8371d3cc (patch)
tree311887f68ae88d93be522e5eb351cad80ad19150 /tools
parentspeedo,w32: Install ntbtls as a library (diff)
downloadgnupg2-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-xtools/gpg-authcode-sign.sh10
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 \