summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xupdate-sources8
1 files changed, 8 insertions, 0 deletions
diff --git a/update-sources b/update-sources
index 8cae06165..1b4e98daf 100755
--- a/update-sources
+++ b/update-sources
@@ -8,6 +8,12 @@ if [ $# -eq 0 ]; then
[ -d "${srcDir}" ] || exit 0
+ lockFile="${srcDir}/.lock"
+ if [ -s "${lockFile}" ] && kill -0 "$(cat "${lockFile}")"; then
+ exit
+ fi
+ echo $$ >"${lockFile}"
+
find "${srcDir}" \
-type d \
-exec sh -c 'test -f "{}/HEAD"' \; \
@@ -19,6 +25,8 @@ if [ $# -eq 0 ]; then
-prune \
| parallel -j 0 -l 1 "$0"
+ rm -f "${lockFile}"
+
elif [ $# -eq 1 ]; then
case "${1%%: *}" in