export HG := $(call qstrip,$(BR2_HG)) $(QUIET)
export SCP := $(call qstrip,$(BR2_SCP)) $(QUIET)
SSH := $(call qstrip,$(BR2_SSH)) $(QUIET)
-LOCALFILES := $(call qstrip,$(BR2_LOCALFILES))
+export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES))
# Default spider mode is 'DOWNLOAD'. Other possible values are 'SOURCE_CHECK'
# used by the _source-check target and 'SHOW_EXTERNAL_DEPS', used by the
define DOWNLOAD_LOCALFILES
test -e $(DL_DIR)/$(2) || \
- $(LOCALFILES) $(call stripurischeme,$(call qstrip,$(1))) $(DL_DIR)
+ $(EXTRA_ENV) support/download/cp $(call stripurischeme,$(call qstrip,$(1))) \
+ $(DL_DIR)
endef
define SOURCE_CHECK_LOCALFILES
--- /dev/null
+#!/bin/bash
+
+# We want to catch any command failure, and exit immediately
+set -e
+
+# Download helper for cp
+# Call it with:
+# $1: source file
+# $2: output file
+# And this environment:
+# LOCALFILES: the cp command to call
+
+source="${1}"
+output="${2}"
+
+${LOCALFILES} "${source}" "${output}"