get: file lock changes

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
This commit is contained in:
Ian Leonard 2018-11-13 01:31:20 +00:00
parent 022b549dac
commit 1c690c031a

View File

@ -14,15 +14,11 @@ fi
# Avoid concurrent processing of the same package # Avoid concurrent processing of the same package
lock_source_dir() { lock_source_dir() {
local _isblocked=N
exec 99<"${SOURCES}/${1}" exec 99<"${SOURCES}/${1}"
while ! flock --nonblock --exclusive 99; do if ! flock --nonblock --exclusive 99; then
if [ ${_isblocked} = N ]; then echo "Project/Device ${DEVICE:-${PROJECT}} waiting, to avoid concurrent processing of ${1}..."
echo "Project/Device ${DEVICE:-${PROJECT}} waiting, to avoid concurrent processing of ${1}..." flock --exclusive 99
_isblocked=Y fi
fi
sleep 1
done
} }
if [ -n "${PKG_URL}" -a -n "${PKG_SOURCE_NAME}" ]; then if [ -n "${PKG_URL}" -a -n "${PKG_SOURCE_NAME}" ]; then