aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2022-11-28 12:41:33 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2022-11-28 12:41:33 -0800
commitb60c4a15e4ab32d16e8648bd448801e02903321e (patch)
tree6c01eccf54b0bb9b8a07039078c48e04e9b92fb7
parentautobuilds: add loong (diff)
downloadmastermirror-scripts-b60c4a15e4ab32d16e8648bd448801e02903321e.tar.gz
mastermirror-scripts-b60c4a15e4ab32d16e8648bd448801e02903321e.tar.bz2
mastermirror-scripts-b60c4a15e4ab32d16e8648bd448801e02903321e.zip
sign-autobuilds: avoid cleansign error on EEXISTS20221128T204158Z
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-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