From e80c4b73ceb10c38a93c769e681afb947d9dfb1c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 9 Jun 2024 15:37:13 +0100 Subject: create a lock file during builds prevent duplicate main instances of the build system from running the lock file is deleted when the parent process exits, alongside the tmpdir deletion the build system must only ever be run ot one instance at a time, per work directory Signed-off-by: Leah Rowe --- build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'build') diff --git a/build b/build index 74ea1de6..bfd865c2 100755 --- a/build +++ b/build @@ -124,7 +124,8 @@ fetch_trees() fail() { - tmp_cleanup || printf "WARNING: can't rm tmpdir: %s\n" "$tmpdir" 1>&2 + tmp_cleanup || printf "WARNING: can't rm tmp files: %s\n" "$tmpdir" \ + 1>&2 err_ "${1}" } @@ -132,6 +133,7 @@ tmp_cleanup() { [ "$tmpdir_was_set" = "n" ] || return 0 rm -Rf "$tmpdir" || return 1 + rm -f lock || return 1 } main $@ -- cgit v1.2.1