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
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