@@ -19,6 +19,7 @@ SSH := $(call qstrip,$(BR2_SSH))
export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES))
DL_WRAPPER = support/download/dl-wrapper
+FLOCK = flock $($(PKG)_DL_DIR)/
# DL_DIR may have been set already from the environment
ifeq ($(origin DL_DIR),undefined)
@@ -91,7 +92,8 @@ endif
define DOWNLOAD
$(Q)$(if $(filter bzr cvs hg svn,$($(PKG)_SITE_METHOD)),BR_NO_CHECK_HASH_FOR=$(notdir $(1));) \
- $(EXTRA_ENV) $(DL_WRAPPER) \
+ $(Q)mkdir -p $($(PKG)_DL_DIR)/
+ $(EXTRA_ENV) $(FLOCK) $(DL_WRAPPER) \
-c $($(PKG)_DL_VERSION) \
-f $(notdir $(1)) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
@@ -50,7 +50,6 @@ main() {
if [ -z "${output}" ]; then
error "no output specified, use -o\n"
fi
- mkdir -p "$(dirname "${output}")"
# If the output file already exists and:
# - there's no .hash file: do not download it again and exit promptly