From 1c690c031a66c736a93202fc44a58b379908034e Mon Sep 17 00:00:00 2001 From: Ian Leonard Date: Tue, 13 Nov 2018 01:31:20 +0000 Subject: [PATCH] get: file lock changes Signed-off-by: Ian Leonard --- scripts/get | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/get b/scripts/get index 895732d1ab..ee51aca4e5 100755 --- a/scripts/get +++ b/scripts/get @@ -14,15 +14,11 @@ fi # Avoid concurrent processing of the same package lock_source_dir() { - local _isblocked=N exec 99<"${SOURCES}/${1}" - while ! flock --nonblock --exclusive 99; do - if [ ${_isblocked} = N ]; then - echo "Project/Device ${DEVICE:-${PROJECT}} waiting, to avoid concurrent processing of ${1}..." - _isblocked=Y - fi - sleep 1 - done + if ! flock --nonblock --exclusive 99; then + echo "Project/Device ${DEVICE:-${PROJECT}} waiting, to avoid concurrent processing of ${1}..." + flock --exclusive 99 + fi } if [ -n "${PKG_URL}" -a -n "${PKG_SOURCE_NAME}" ]; then