aboutsummaryrefslogtreecommitdiff
path: root/package/pkg-download.mk
diff options
context:
space:
mode:
authorGravatar Yann E. MORIN <yann.morin.1998@free.fr>2014-07-02 23:11:23 +0200
committerGravatar Peter Korsgaard <peter@korsgaard.com>2014-07-03 00:00:15 +0200
commit4bee7629eeb524b774357f57fbe53f136ae812c0 (patch)
treefba3b3a43230831bbfe4de5eb4cb889a8fad2185 /package/pkg-download.mk
parent2fd4b959bd8b8e9d8657de9f458215ecd3b9d072 (diff)
downloadbuildroot-4bee7629eeb524b774357f57fbe53f136ae812c0.tar.gz
buildroot-4bee7629eeb524b774357f57fbe53f136ae812c0.tar.bz2
pkg-infra: move the wget download helper to a script
Maintaining the download helpers in the Makefile has proved to be a bit complex, so move it to a shell script. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/pkg-download.mk')
-rw-r--r--package/pkg-download.mk13
1 files changed, 3 insertions, 10 deletions
diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index 3290b6ba71..75545820ad 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -8,7 +8,7 @@
################################################################################
# Download method commands
-WGET := $(call qstrip,$(BR2_WGET)) $(QUIET)
+export WGET := $(call qstrip,$(BR2_WGET)) $(QUIET)
export SVN := $(call qstrip,$(BR2_SVN))
export CVS := $(call qstrip,$(BR2_CVS))
BZR := $(call qstrip,$(BR2_BZR))
@@ -175,17 +175,10 @@ define SHOW_EXTERNAL_DEPS_HG
echo $($(PKG)_SOURCE)
endef
-# Download a file using wget. Only download the file if it doesn't
-# already exist in the download directory. If the download fails,
-# remove the file (because wget -O creates a 0-byte file even if the
-# download fails). To handle an interrupted download as well, download
-# to a temporary file first. The temporary file will be overwritten
-# the next time the download is tried.
+
define DOWNLOAD_WGET
test -e $(DL_DIR)/$(2) || \
- ($(WGET) -O $(DL_DIR)/$(2).tmp '$(call qstrip,$(1))' && \
- mv $(DL_DIR)/$(2).tmp $(DL_DIR)/$(2)) || \
- (rm -f $(DL_DIR)/$(2).tmp ; exit 1)
+ $(EXTRA_ENV) support/download/wget '$(call qstrip,$(1))' $(DL_DIR)/$(2)
endef
define SOURCE_CHECK_WGET