Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-07 09:36:19 +0100
committerErich Eckner <git@eckner.net>2018-02-07 09:36:19 +0100
commiteebf4ff1ff5f243645999857e021d7749c45090d (patch)
tree354f073b45f7ecd7734355de5119c16bd4f6b5b8 /bin
parent4d289c1d38a240b6e7f5a2a3c805bbb82c459ae9 (diff)
bin/build-master-status-from-mysql: get shared build-list lock
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-master-status-from-mysql4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/build-master-status-from-mysql b/bin/build-master-status-from-mysql
index 408ef1e..7a3d7e6 100755
--- a/bin/build-master-status-from-mysql
+++ b/bin/build-master-status-from-mysql
@@ -10,6 +10,10 @@
tmp_dir=$(mktemp -d 'tmp.build-master-status-from-mysql.XXXXXXXXXX' --tmpdir)
trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
+# always block if locked
+exec 9> "${build_list_lock_file}"
+flock -s 9
+
# shellcheck disable=SC2016
{
printf 'SELECT DISTINCT `package_sources`.`pkgbase`,`package_sources`.`git_revision`,`package_sources`.`mod_git_revision`,`upstream_repositories`.`name`'