summaryrefslogtreecommitdiffstats
path: root/gitmirror
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-04-29 13:20:48 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-04-29 13:20:48 -0700
commit8a749f6100907e0d150ac8e0e0d273d2550c02d3 (patch)
treef3433fa1efc6b630d15cdba4507eca44f6dc605b /gitmirror
parentce9d67be604cacb7c746a1d2024a0899b548984d (diff)
downloadnasmbuild-8a749f6100907e0d150ac8e0e0d273d2550c02d3.tar.gz
nasmbuild-8a749f6100907e0d150ac8e0e0d273d2550c02d3.tar.xz
nasmbuild-8a749f6100907e0d150ac8e0e0d273d2550c02d3.zip
gitmirror: add force (always hold the lock) mode
Diffstat (limited to 'gitmirror')
-rwxr-xr-xgitmirror/robot-wrapper.sh2
-rwxr-xr-xgitmirror/robot.sh8
2 files changed, 7 insertions, 3 deletions
diff --git a/gitmirror/robot-wrapper.sh b/gitmirror/robot-wrapper.sh
index 8cca014..dd6231b 100755
--- a/gitmirror/robot-wrapper.sh
+++ b/gitmirror/robot-wrapper.sh
@@ -1,3 +1,3 @@
#!/bin/sh
cd /home/nasmbuild/gitmirror
-exec ./robot.sh > log/`date +%Y%m%d.%H%M.log` 2>&1
+exec ./robot.sh "$@" > log/`date +%Y%m%d.%H%M.log` 2>&1
diff --git a/gitmirror/robot.sh b/gitmirror/robot.sh
index fcfd318..f1c6875 100755
--- a/gitmirror/robot.sh
+++ b/gitmirror/robot.sh
@@ -16,7 +16,11 @@ slave="$HOME/gitmirror/nasm-mail.git"
date=$(date -uR)
(
- flock -nx 8 || exit 0
+ if [ "$1" -eq "force" ]; then
+ flock -x 9
+ else
+ flock -nx 9 || exit 0
+ fi
cd "$MASTER"
git fetch -f
@@ -60,4 +64,4 @@ date=$(date -uR)
mv -f branches.id.new branches.id
mv -f branches.heads branches.heads.saved
fi
-) 8< "$0"
+) 9< "$0"