summaryrefslogtreecommitdiff
path: root/bin/get-package-updates
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-08 08:46:32 +0200
committerErich Eckner <git@eckner.net>2017-06-08 08:46:32 +0200
commit838c46e3140e95f95d5850e134f91a1f8acbb5eb (patch)
treef880610fc707cacce386cb2ed25fb466c2987087 /bin/get-package-updates
parentb3d55133c9ba450676249aa9641f00020300ab2b (diff)
downloadbuilder-838c46e3140e95f95d5850e134f91a1f8acbb5eb.tar.xz
bin/get-package-updates: clean up build-list lock option
Diffstat (limited to 'bin/get-package-updates')
-rwxr-xr-xbin/get-package-updates20
1 files changed, 7 insertions, 13 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index 928fe5d..4ca3679 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -29,13 +29,13 @@ eval set -- "$(
echo usage
)"
-block=false
+block_flag='-n'
while true
do
case "$1" in
-b|--block)
- block=true
+ block_flag=''
;;
-h|--help)
usage 0
@@ -94,17 +94,11 @@ done
# Create a lock file for build list.
-while true; do
- exec 9> "${build_list_lock_file}"
- if flock -n 9; then
- break
- fi
- if ! ${block}; then
- >&2 echo 'come back (shortly) later - I cannot lock build list.'
- exit
- fi
- sleep 0.1
-done
+exec 9> "${build_list_lock_file}"
+if ! flock ${block_flag} 9; then
+ >&2 echo 'come back (shortly) later - I cannot lock build list.'
+ exit
+fi
echo 'Check modified packages from the last update, and put them to the build list.'