summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-09 15:37:13 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-09 15:37:13 +0100
commite80c4b73ceb10c38a93c769e681afb947d9dfb1c (patch)
tree9d684ceb33bfe1229b4efec39dfa4f5d156dbbcd /build
parenta0710ef9cac6e9f27852676d1bafa5d8c5f8ac47 (diff)
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 <leah@libreboot.org>
Diffstat (limited to 'build')
-rwxr-xr-xbuild4
1 files changed, 3 insertions, 1 deletions
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 $@