summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2023-08-07 13:23:35 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2023-08-07 13:23:35 -0700
commitf36d4dc72fab1bc42d5689151cee2a433f5c2c68 (patch)
tree400af47e87a49f829c40637ffca23311705e8b56
parentbinpackages: new sign&sync script (diff)
downloadmastermirror-scripts-f36d4dc72fab1bc42d5689151cee2a433f5c2c68.tar.gz
mastermirror-scripts-f36d4dc72fab1bc42d5689151cee2a433f5c2c68.tar.bz2
mastermirror-scripts-f36d4dc72fab1bc42d5689151cee2a433f5c2c68.zip
sign-sync-binpackages: refactor lockfile
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xsign-sync-binpackages.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/sign-sync-binpackages.sh b/sign-sync-binpackages.sh
index 7db6611..4dfe034 100755
--- a/sign-sync-binpackages.sh
+++ b/sign-sync-binpackages.sh
@@ -43,15 +43,17 @@ export BINPKG_GPG_SIGNING_GPG_HOME=/home/gmirror/.gnupg-releng
export BINPKG_GPG_SIGNING_KEY=13EBBDBEDE7A12775DFDB1BABB572E0E2D182910
export BINPKG_GPG_VERIFY_GPG_HOME=${BINPKG_GPG_SIGNING_GPG_HOME}
+export LOCKFILE=${STAGINGTREE}/.running
+
# this script needs to be run as gmirror user
[[ $(whoami) == "gmirror" ]] || exit 111
# we make sure we're not running twice in parallel
-if [[ -f ${STAGINGTREE}/.running ]] ; then
- echo sign-sync-binpackages.sh lockfile ${STAGINGTREE}/.running exists, aborting
+if [[ -f ${LOCKFILE} ]] ; then
+ echo sign-sync-binpackages.sh lockfile ${LOCKFILE} exists, aborting
exit 112
fi
-touch ${STAGINGTREE}/.running || exit 110
+touch ${LOCKFILE} || exit 110
# make sure we have an updated gpg-agent
gpgconf --kill all
@@ -114,4 +116,4 @@ done
# we're done so remove the "lockfile"
-rm ${STAGINGTREE}/.running
+rm ${LOCKFILE}