aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsign-autobuilds.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/sign-autobuilds.sh b/sign-autobuilds.sh
index 9e8fd66..832964d 100755
--- a/sign-autobuilds.sh
+++ b/sign-autobuilds.sh
@@ -33,8 +33,11 @@ signone() {
signone_clearsign() {
# only for text files!
f="$1"
- $DEBUGP ${GPG} --armor --clearsign "${f}"
- $DEBUGP mv "${f}".asc "${f}"
+ d="${1}.asc.tmp"
+ rm -f "$d"
+ # Clearsign aborts if the destfile exists
+ $DEBUGP ${GPG} --armor --clearsign --output "$d" "${f}"
+ $DEBUGP mv "${d}" "${f}"
}
gpgconf --kill all
@@ -69,12 +72,7 @@ done
#echo "Text helper files:"
-files="$(find autobuilds -name '*.sha256' -or -name '*.DIGESTS')"
-unsigned=""
-for dgst in $files ; do
- grep -sq "BEGIN PGP SIGNED MESSAGE-----" $dgst || unsigned="${unsigned} ${dgst}"
-done
-
+unsigned="$(find autobuilds \( -name '*.sha256' -or -name '*.DIGESTS' \) -exec grep -L -e '^-----BEGIN PGP SIGNED MESSAGE-----$' \{} \+ )"
for dgst in $unsigned ; do
$VERBOSEP echo "Signing (inline/cleartext) $dgst"
signone_clearsign $dgst