Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconf/master.conf.example1
-rwxr-xr-xlib/intentions-queue8
-rwxr-xr-xlib/load-configuration4
3 files changed, 13 insertions, 0 deletions
diff --git a/conf/master.conf.example b/conf/master.conf.example
index 38419ef..5cf9c90 100755
--- a/conf/master.conf.example
+++ b/conf/master.conf.example
@@ -41,6 +41,7 @@
#build_list_lock_file="${work_dir}/build-list.lock"
#check_mirrors_lock_file="${work_dir}/check-mirrors.lock"
#harvest_commit_times_lock_file="${work_dir}/harvest-commit-times.lock"
+#intentions_lock_file="${work_dir}/intentions.lock"
#package_database_lock_file="${work_dir}/package-database.lock"
#sanity_check_lock_file="${work_dir}/sanity-check.lock"
#status_lock_file="${work_dir}/status.lock"
diff --git a/lib/intentions-queue b/lib/intentions-queue
index 61ec4f3..f244e1b 100755
--- a/lib/intentions-queue
+++ b/lib/intentions-queue
@@ -92,7 +92,15 @@ intentions_left() {
# execute_all_intentions
# executes all intentions
execute_all_intentions() {
+ exec 6> "${intentions_lock_file}"
+ if ! verbose_flock 6; then
+ >&2 echo 'someone already executes intentions - no need to schedule a second run'
+ return
+ fi
+
while intentions_left -n; do
execute_intention
done
+
+ flock -u 6
}
diff --git a/lib/load-configuration b/lib/load-configuration
index cc9fe7f..e7af638 100755
--- a/lib/load-configuration
+++ b/lib/load-configuration
@@ -174,6 +174,10 @@ if [ -z "${harvest_commit_times_lock_file}" ]; then
harvest_commit_times_lock_file="${work_dir}/harvest-commit-times.lock"
fi
+if [ -z "${intentions_lock_file}" ]; then
+ intentions_lock_file="${work_dir}/intentions.lock"
+fi
+
if [ -z "${package_database_lock_file}" ]; then
package_database_lock_file="${work_dir}/package-database.lock"
fi