Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-09 14:53:53 +0200
committerErich Eckner <git@eckner.net>2017-06-09 14:53:53 +0200
commit40e562a93a293b65b85d7980c871219d8218ec6a (patch)
tree19e912859e61f195e8d0d7fa603c1a854f634488
parent598467074c2cae67336e7279c187b7768bf09849 (diff)
introduce lock file for package database
-rwxr-xr-xbin/return-assignment6
-rwxr-xr-xconf/default.conf4
2 files changed, 10 insertions, 0 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index b217409..04648ca 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -22,13 +22,19 @@
# Create a lock file and a trap.
exec 9> "${build_list_lock_file}"
+exec 8> "${package_database_lock_file}"
if ! flock -n 9; then
>&2 echo 'come back (shortly) later - I cannot lock build list.'
exit 1
fi
+if ! flock -n 8; then
+ >&2 echo 'come back (shortly) later - I cannot lock package database.'
+ exit 1
+fi
function clean_up_lock_file {
rm -f "${build_list_lock_file}"
+ rm -f "${package_database_lock_file}"
}
trap clean_up_lock_file EXIT
diff --git a/conf/default.conf b/conf/default.conf
index 1d29509..947196f 100755
--- a/conf/default.conf
+++ b/conf/default.conf
@@ -42,6 +42,10 @@ if [ -z "${build_list_lock_file}" ]; then
build_list_lock_file="${work_dir}/build-list.lock"
fi
+if [ -z "${package_database_lock_file}" ]; then
+ package_database_lock_file="${work_dir}/package-database.lock"
+fi
+
mkdir -p "${work_dir}"
touch "${work_dir}/build-list"
touch "${work_dir}/deletion-list"