aboutsummaryrefslogtreecommitdiff
path: root/package/pkg-download.mk
diff options
context:
space:
mode:
authorGravatar Yann E. MORIN <yann.morin.1998@free.fr>2014-12-11 23:52:05 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-12-11 23:58:37 +0100
commit78b92e5055442e225b10ca6baf98f23a0fa8a102 (patch)
tree08b3606e9c59645391b6d30138bb4233f3475f50 /package/pkg-download.mk
parentf8639c79d8f8af4ac01176e64d69062ac4644561 (diff)
downloadbuildroot-78b92e5055442e225b10ca6baf98f23a0fa8a102.tar.gz
buildroot-78b92e5055442e225b10ca6baf98f23a0fa8a102.tar.bz2
support/download: add option parsing to the download wrapper
Instead of relying on argument ordering, use actual options in the download wrapper. Download backends (bzr, cp, hg...) are left as-is, because it does not make sense to complexify them, since they are almost very trivial shell scripts, and adding option parsing would be really overkill. This commit also renames the script to dl-wrapper so it looks better in the traces, and it is not confused with another wrapper. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/pkg-download.mk')
-rw-r--r--package/pkg-download.mk42
1 files changed, 26 insertions, 16 deletions
diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index 190b5b7e99..8424ecafdd 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -18,6 +18,8 @@ export SCP := $(call qstrip,$(BR2_SCP)) $(QUIET)
SSH := $(call qstrip,$(BR2_SSH)) $(QUIET)
export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES))
+DL_WRAPPER = support/download/dl-wrapper
+
# Default spider mode is 'DOWNLOAD'. Other possible values are 'SOURCE_CHECK'
# used by the _source-check target and 'SHOW_EXTERNAL_DEPS', used by the
# external-deps target.
@@ -95,8 +97,9 @@ endef
# problems
define DOWNLOAD_GIT
test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
- $(EXTRA_ENV) support/download/wrapper git \
- $(DL_DIR)/$($(PKG)_SOURCE) \
+ $(EXTRA_ENV) $(DL_WRAPPER) -b git \
+ -o $(DL_DIR)/$($(PKG)_SOURCE) \
+ -- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
$($(PKG)_BASE_NAME)
@@ -115,8 +118,9 @@ endef
define DOWNLOAD_BZR
test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
- $(EXTRA_ENV) support/download/wrapper bzr \
- $(DL_DIR)/$($(PKG)_SOURCE) \
+ $(EXTRA_ENV) $(DL_WRAPPER) -b bzr \
+ -o $(DL_DIR)/$($(PKG)_SOURCE) \
+ -- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
$($(PKG)_BASE_NAME)
@@ -132,8 +136,9 @@ endef
define DOWNLOAD_CVS
test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
- $(EXTRA_ENV) support/download/wrapper cvs \
- $(DL_DIR)/$($(PKG)_SOURCE) \
+ $(EXTRA_ENV) $(DL_WRAPPER) -b cvs \
+ -o $(DL_DIR)/$($(PKG)_SOURCE) \
+ -- \
$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) \
$($(PKG)_DL_VERSION) \
$($(PKG)_RAWNAME) \
@@ -151,8 +156,9 @@ endef
define DOWNLOAD_SVN
test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
- $(EXTRA_ENV) support/download/wrapper svn \
- $(DL_DIR)/$($(PKG)_SOURCE) \
+ $(EXTRA_ENV) $(DL_WRAPPER) -b svn \
+ -o $(DL_DIR)/$($(PKG)_SOURCE) \
+ -- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
$($(PKG)_BASE_NAME)
@@ -171,8 +177,9 @@ endef
# to prepend the path with a slash: scp://[user@]host:/absolutepath
define DOWNLOAD_SCP
test -e $(DL_DIR)/$(2) || \
- $(EXTRA_ENV) support/download/wrapper scp \
- $(DL_DIR)/$(2) \
+ $(EXTRA_ENV) $(DL_WRAPPER) -b scp \
+ -o $(DL_DIR)/$(2) \
+ -- \
'$(call stripurischeme,$(call qstrip,$(1)))' && \
$(call VERIFY_HASH,$(PKGDIR)/$($(PKG)_RAWNAME).hash,$(DL_DIR)/$(2))
endef
@@ -188,8 +195,9 @@ endef
define DOWNLOAD_HG
test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
- $(EXTRA_ENV) support/download/wrapper hg \
- $(DL_DIR)/$($(PKG)_SOURCE) \
+ $(EXTRA_ENV) $(DL_WRAPPER) -b hg \
+ -o $(DL_DIR)/$($(PKG)_SOURCE) \
+ -- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
$($(PKG)_BASE_NAME)
@@ -208,8 +216,9 @@ endef
define DOWNLOAD_WGET
test -e $(DL_DIR)/$(2) || \
- $(EXTRA_ENV) support/download/wrapper wget \
- $(DL_DIR)/$(2) \
+ $(EXTRA_ENV) $(DL_WRAPPER) -b wget \
+ -o $(DL_DIR)/$(2) \
+ -- \
'$(call qstrip,$(1))' && \
$(call VERIFY_HASH,$(PKGDIR)/$($(PKG)_RAWNAME).hash,$(DL_DIR)/$(2))
endef
@@ -224,8 +233,9 @@ endef
define DOWNLOAD_LOCALFILES
test -e $(DL_DIR)/$(2) || \
- $(EXTRA_ENV) support/download/wrapper cp \
- $(DL_DIR)/$(2) \
+ $(EXTRA_ENV) $(DL_WRAPPER) -b cp \
+ -o $(DL_DIR)/$(2) \
+ -- \
$(call stripurischeme,$(call qstrip,$(1))) && \
$(call VERIFY_HASH,$(PKGDIR)/$($(PKG)_RAWNAME).hash,$(DL_DIR)/$(2))
endef