Merge pull request #4676 from MilhouseVH/less_messy_locking

build: Take a lock on the package download directory
This commit is contained in:
Stephan Raue 2016-02-08 12:43:56 +01:00
commit 5d25757702

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