From 54282a81301fd506a934c2bb9801e1775e65e99d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 31 Aug 2021 19:55:45 +0200 Subject: update-sources: add lock --- update-sources | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'update-sources') 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 -- cgit v1.2.3-54-g00ecf