From 838c46e3140e95f95d5850e134f91a1f8acbb5eb Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 8 Jun 2017 08:46:32 +0200 Subject: bin/get-package-updates: clean up build-list lock option --- bin/get-package-updates | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'bin/get-package-updates') 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.' -- cgit v1.2.3-54-g00ecf