build: Take a lock on the package download directory

This commit is contained in:
MilhouseVH 2016-02-04 09:51:00 +00:00
parent 5704075605
commit dc12bbd8a6

View File

@ -32,7 +32,7 @@ if [ -n "$PKG_URL" ]; then
# Avoid concurrent downloads of the same package
_isblocked=N
exec 99>$SOURCES/$1/.lock
exec 99<$SOURCES/$1
while ! flock --nonblock --exclusive 99; do
[ ${_isblocked} == N ] && { echo "Project ${PROJECT} waiting to avoid concurrent download of ${1}..."; _isblocked=Y; }
sleep 1