Skip to contentSkip to conversation

DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

PATCH New Alvaro Gamez 2 participants 14 messages Feb 15, 2012 – Feb 18, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

This patch modifies the definition of DOWNLOAD to receive two arguments.

I think this is the generic solution to the problem, even though it is a change to the API.

However, by making the second parameter optional, it could be possible to reduce
code. To keep the more generic way, the .mk files that needed to be changed to the new API are kept with both arguments to the call of the function.

Same thing with the, to my knowledge, unused SOURCE_CHECK_WGET and SCP functions.

2012/2/14 Arnout Vandecappelle <[email protected]>

Quoted 74 lines

**

Quoted 9 lines · On Tuesday 14 February 2012 18:54:22 Spenser Gilliland wrote:

After greping through the source the enormity of that patch and the

potential for out of tree breakage suggest a different course of

action. A possible solution may be to scan the SITE var for a

question mark and only change to non-slash mode on that occasion.

Would this be reasonable?

Yeah, my patch was too easy :-)

I think it's better to keep the split at the /

We could use either

microblaze_v2.0.git;a=blob;f=microblaze-unknown-linux-gnu.tgz

or

?p=xldk/microblaze_v2.0.git;a=blob;f=microblaze-unknown-linux-gnu.tgz

as the _SOURCE. Of course, that still requires some serious massaging

to avoid funky filenames that break everything. So probably not an

option either.

I think on the short term it is probably best to use a work-around

like for the blackfin toolchain: a non-standard download target, that

doesn't use the DOWNLOAD function but a custom $(WGET) call.

On the longer term we could try to refactor that into the generic

DOWNLOAD function.

Regards,

Arnout

--

Arnout Vandecappelle arnout at mind be

Senior Embedded Software Architect +32-16-286540

Essensium/Mind http://www.mind.be

G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven

LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle

GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 11 lines
?lvaro G?mez Machado
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120215/29a795f6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-DOWNLOAD-change-1-DIRECTORY_URL-2-FILE_NAME-to-1-FUL.patch
Type: text/x-patch
Size: 14833 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120215/29a795f6/attachment-0001.bin>
#1 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

Somehow I lost part of the explanation on the commit message.

The difference is that now $1 stores the full URL of the file, whereas $2 stores the name of the file as we want it to be named after download complets.

For example, a full copy-paste from Xilinx git:
URL='
http://git.xilinx.com/?p=xldk/microblaze_v2.0_le.git;a=blob;f=microblazeel-unknown-linux-gnu.tgz;h=d7b493c5dbcc24ba9cc3be2e4c14d6d9701e6805;hb=HEAD
'
FILE='microblazeel-unknown-linux-gnu.tgz'

$(call DOWNLOAD,$(URL),$(FILE))

In case we know for sure the downloaded file is going to have the name we want, we can omit the second parameter:

URL=ftp://ftp.idsoftware.com/idstuff/doom/doom-$(DOOM_WAD_VERSION).wad.gz $(call DOWNLOAD,$(URL))

2012/2/15 Alvaro Gamez <[email protected]>

Quoted 100 lines

This patch modifies the definition of DOWNLOAD to receive two arguments.

I think this is the generic solution to the problem, even though it is a change to the API.

However, by making the second parameter optional, it could be possible to reduce
code. To keep the more generic way, the .mk files that needed to be changed to the new API are kept with both arguments to the call of the function.

Same thing with the, to my knowledge, unused SOURCE_CHECK_WGET and SCP functions.

2012/2/14 Arnout Vandecappelle <[email protected]>

Quoted 65 lines

**

Quoted 9 lines · On Tuesday 14 February 2012 18:54:22 Spenser Gilliland wrote:

After greping through the source the enormity of that patch and the

potential for out of tree breakage suggest a different course of

action. A possible solution may be to scan the SITE var for a

question mark and only change to non-slash mode on that occasion.

Would this be reasonable?

Yeah, my patch was too easy :-)

I think it's better to keep the split at the /

We could use either

microblaze_v2.0.git;a=blob;f=microblaze-unknown-linux-gnu.tgz

or

?p=xldk/microblaze_v2.0.git;a=blob;f=microblaze-unknown-linux-gnu.tgz

as the _SOURCE. Of course, that still requires some serious massaging

to avoid funky filenames that break everything. So probably not an

option either.

I think on the short term it is probably best to use a work-around

like for the blackfin toolchain: a non-standard download target, that

doesn't use the DOWNLOAD function but a custom $(WGET) call.

On the longer term we could try to refactor that into the generic

DOWNLOAD function.

Regards,

Arnout

--

Arnout Vandecappelle arnout at mind be

Senior Embedded Software Architect +32-16-286540

Essensium/Mind http://www.mind.be

G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven

LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle

Quoted 9 lines

GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--
?lvaro G?mez Machado

Signature · 4 lines
?lvaro G?mez Machado
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120215/3ea3e3f2/attachment.html>
#2 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

In reply to Alvaro Gamez

From: "Alvaro G. M" <[email protected]>

This patch modifies the definition of DOWNLOAD to receive two arguments.

I think this is the generic solution to the problem, even though it is a change to the API.

However, by making the second parameter optional, it could be possible to reduce code. To keep the more generic way, the .mk files that needed to be changed to the new API are kept with both arguments to the call of the function.

Same thing with the, to my knowledge, unused SOURCE_CHECK_WGET and SCP functions.

The difference is that now $1 stores the full URL of the file, whereas $2 stores the name of the file as we want it to be named after download complets.

For example, a full copy-paste from Xilinx git:
URL='http://git.xilinx.com/?p=xldk/microblaze_v2.0_le.git;a=blob;f=microblazeel-unknown-linux-gnu.tgz;h=d7b493c5dbcc24ba9cc3be2e4c14d6d9701e6805;hb=HEAD' FILE='microblazeel-unknown-linux-gnu.tgz'

$(call DOWNLOAD,$(URL),$(FILE))

In case we know for sure the downloaded file is going to have the name we want, we can omit the second parameter:

URL=ftp://ftp.idsoftware.com/idstuff/doom/doom-$(DOOM_WAD_VERSION).wad.gz $(call DOWNLOAD,$(URL))

---
[Arnout] Reposting as an in-line patch, for simpler reviewing. Alvaro, if you use 'git send-email' to send you patches, it is easier to review and apply them. See the man page of git send-email for an explanation how to use it with GMail.

---
 docs/buildroot.html                         |    2 +-
 docs/manual/adding-packages-handwritten.txt |    2 +-
 linux/linux.mk                              |    2 +-
 package/Makefile.package.in                 |   14 +++++++++-----
 package/cups/cups.mk                        |    2 +-
 package/fis/fis.mk                          |    2 +-
 package/games/doom-wad/doom-wads.mk         |    2 +-
 package/gettext/gettext.mk                  |    2 +-
 package/microperl/microperl.mk              |    2 +-
 package/netkitbase/netkitbase.mk            |    2 +-
 package/netkittelnet/netkittelnet.mk        |    2 +-
 package/newt/newt.mk                        |    2 +-
 package/tinyhttpd/tinyhttpd.mk              |    2 +-
 package/ttcp/ttcp.mk                        |    2 +-
 package/uemacs/uemacs.mk                    |    2 +-
 package/vpnc/vpnc.mk                        |    2 +-
 package/xfsprogs/xfsprogs.mk                |    2 +-
 toolchain/gcc/gcc-uclibc-4.x.mk             |    2 +-
 toolchain/gdb/gdb.mk                        |    2 +-
 toolchain/kernel-headers/kernel-headers.mk  |    2 +-
 toolchain/toolchain-external/ext-tool.mk    |    6 +++---
 toolchain/uClibc/uclibc.mk                  |    2 +-
 22 files changed, 32 insertions(+), 28 deletions(-)
docs/buildroot.html +1 -1
index ddfb20a..e0f6ad8 100644
@@ -1542,7 +1542,7 @@ LIBFOO_POST_PATCH_HOOKS += LIBFOO_POST_PATCH_FIXUP
 11: LIBFOO_TARGET_BINARY:=usr/bin/foo
 12:
 <span id="ex2line13">13: $(DL_DIR)/$(LIBFOO_SOURCE):</span>
-14: 	$(call DOWNLOAD,$(LIBFOO_SITE),$(LIBFOO_SOURCE))
+14: 	$(call DOWNLOAD,$(LIBFOO_SITE)/$(LIBFOO_SOURCE),$(LIBFOO_SOURCE))
 15:
 <span id="ex2line16">16: $(LIBFOO_DIR)/.source: $(DL_DIR)/$(LIBFOO_SOURCE)</span>
 17: 	$(ZCAT) $(DL_DIR)/$(LIBFOO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
docs/manual/adding-packages-handwritten.txt +1 -1
index a9d247c..938885a 100644
@@ -22,7 +22,7 @@ existing manual makefiles and to help understand how they work.*
 11: LIBFOO_TARGET_BINARY:=usr/bin/foo
 12:
 13: $(DL_DIR)/$(LIBFOO_SOURCE):
-14: 	$(call DOWNLOAD,$(LIBFOO_SITE),$(LIBFOO_SOURCE))
+14: 	$(call DOWNLOAD,$(LIBFOO_SITE)/$(LIBFOO_SOURCE),$(LIBFOO_SOURCE))
 15:
 16: $(LIBFOO_DIR)/.source: $(DL_DIR)/$(LIBFOO_SOURCE)
 17: 	$(ZCAT) $(DL_DIR)/$(LIBFOO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
linux/linux.mk +1 -1
index ae236d4..d1a05a1 100644
@@ -98,7 +98,7 @@ define LINUX_DOWNLOAD_PATCHES
 	$(if $(LINUX_PATCHES),
 		@$(call MESSAGE,"Download additional patches"))
 	$(foreach patch,$(filter ftp://% http://%,$(LINUX_PATCHES)),\
-		$(call DOWNLOAD,$(dir $(patch)),$(notdir $(patch)))$(sep))
+		$(call DOWNLOAD,$(patch),$(notdir $(patch)))$(sep))
 endef
 
 LINUX_POST_DOWNLOAD_HOOKS += LINUX_DOWNLOAD_PATCHES
package/Makefile.package.in +9 -5
index 33461b4..3714de0 100644
@@ -203,11 +203,11 @@ endef
 # to prepend the path with a slash: scp://[user@]host:/absolutepath
 define DOWNLOAD_SCP
 	test -e $(DL_DIR)/$(2) || \
-	$(SCP) $(call stripurischeme,$(call qstrip,$(1)))/$(2) $(DL_DIR)
+	$(SCP) $(call stripurischeme,$(call qstrip,$(1))) $(DL_DIR)/$(2)
 endef
 
 define SOURCE_CHECK_SCP
-	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1)/$(2),:) > /dev/null
+	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1),:) > /dev/null
 endef
 
 define SHOW_EXTERNAL_DEPS_SCP
@@ -237,12 +237,16 @@ endef
 
 
 define DOWNLOAD_WGET
-	test -e $(DL_DIR)/$(2) || \
-	$(WGET) -P $(DL_DIR) $(call qstrip,$(1))/$(2)
+	if test -n "$(2)"; then \
+		test -e $(DL_DIR)/$(2) || \
+		$(WGET) -O $(DL_DIR)/$(2) $(call qstrip,$(1)); \
+	else \
+		$(WGET) $(call qstrip,$(1)) ;\
+	fi
 endef
 
 define SOURCE_CHECK_WGET
-  $(WGET) --spider $(call qstrip,$(1))/$(2)
+  $(WGET) --spider $(call qstrip,$(1))
 endef
 
 define SHOW_EXTERNAL_DEPS_WGET
package/cups/cups.mk +1 -1
index 4e8db71..ed2e72c 100644
@@ -65,7 +65,7 @@ else
 endif
 
 $(DL_DIR)/$(CUPS_SOURCE):
-	 $(call DOWNLOAD,$(CUPS_SITE),$(CUPS_SOURCE))
+	 $(call DOWNLOAD,$(CUPS_SITE)/$(CUPS_SOURCE),$(CUPS_SOURCE))
 
 $(CUPS_DIR)/.unpacked: $(DL_DIR)/$(CUPS_SOURCE)
 	$(CUPS_CAT) $(DL_DIR)/$(CUPS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/fis/fis.mk +1 -1
index 2942449..c400dea 100644
@@ -11,7 +11,7 @@ FIS_BINARY:=fis
 FIS_TARGET_BINARY:=sbin/fis
 
 $(DL_DIR)/$(FIS_SOURCE):
-	 $(call DOWNLOAD,$(FIS_SITE),$(FIS_SOURCE))
+	 $(call DOWNLOAD,$(FIS_SITE)/$(FIS_SOURCE),$(FIS_SOURCE))
 
 fis-source: $(DL_DIR)/$(FIS_SOURCE)
 
package/games/doom-wad/doom-wads.mk +1 -1
index bae2420..2e41ef4 100644
@@ -10,7 +10,7 @@ DOOM_WAD_SITE = ftp://ftp.idsoftware.com/idstuff/doom/
 DOOM_WAD_DIR=$(BUILD_DIR)/doom-wad-$(DOOM_WAD_VERSION)
 
 $(DL_DIR)/$(DOOM_WAD_SOURCE):
-	 $(call DOWNLOAD,$(DOOM_WAD_SITE),$(DOOM_WAD_SOURCE))
+	 $(call DOWNLOAD,$(DOOM_WAD_SITE)/$(DOOM_WAD_SOURCE),$(DOOM_WAD_SOURCE))
 
 doom-wad-source: $(DL_DIR)/$(DOOM_WAD_SOURCE)
 
package/gettext/gettext.mk +1 -1
index f4c8c76..a8a6458 100644
@@ -18,7 +18,7 @@ LIBINTL_TARGET_BINARY:=usr/lib/libintl.so
 endif
 
 $(DL_DIR)/$(GETTEXT_SOURCE):
-	 $(call DOWNLOAD,$(GETTEXT_SITE),$(GETTEXT_SOURCE))
+	 $(call DOWNLOAD,$(GETTEXT_SITE)/$(GETTEXT_SOURCE),$(GETTEXT_SOURCE))
 
 gettext-source: $(DL_DIR)/$(GETTEXT_SOURCE)
 
package/microperl/microperl.mk +1 -1
index b68e825..39cee3d 100644
@@ -18,7 +18,7 @@ MICROPERL_MODS+=File/Basename.pm Errno.pm Config.pm IO/File.pm Symbol.pm \
 	DynaLoader.pm AutoLoader.pm Carp/Heavy.pm
 endif
 $(DL_DIR)/$(MICROPERL_SOURCE):
-	$(call DOWNLOAD,$(MICROPERL_SITE),$(MICROPERL_SOURCE))
+	$(call DOWNLOAD,$(MICROPERL_SITE)/$(MICROPERL_SOURCE),$(MICROPERL_SOURCE))
 
 $(MICROPERL_DIR)/.source: $(DL_DIR)/$(MICROPERL_SOURCE)
 	$(MICROPERL_CAT) $(DL_DIR)/$(MICROPERL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/netkitbase/netkitbase.mk +1 -1
index dde8f9f..632960e 100644
@@ -12,7 +12,7 @@ NETKITBASE_BINARY:=inetd/inetd
 NETKITBASE_TARGET_BINARY:=usr/sbin/inetd
 
 $(DL_DIR)/$(NETKITBASE_SOURCE):
-	 $(call DOWNLOAD,$(NETKITBASE_SITE),$(NETKITBASE_SOURCE))
+	 $(call DOWNLOAD,$(NETKITBASE_SITE)/$(NETKITBASE_SOURCE),$(NETKITBASE_SOURCE))
 
 netkitbase-source: $(DL_DIR)/$(NETKITBASE_SOURCE)
 
package/netkittelnet/netkittelnet.mk +1 -1
index e9f40ca..961ae03 100644
@@ -12,7 +12,7 @@ NETKITTELNET_BINARY:=telnetd/telnetd
 NETKITTELNET_TARGET_BINARY:=usr/sbin/telnetd
 
 $(DL_DIR)/$(NETKITTELNET_SOURCE):
-	 $(call DOWNLOAD,$(NETKITTELNET_SITE),$(NETKITTELNET_SOURCE))
+	 $(call DOWNLOAD,$(NETKITTELNET_SITE)/$(NETKITTELNET_SOURCE),$(NETKITTELNET_SOURCE))
 
 netkittelnet-source: $(DL_DIR)/$(NETKITTELNET_SOURCE)
 
package/newt/newt.mk +1 -1
index eb944a9..a9ed074 100644
@@ -11,7 +11,7 @@ NEWT_VERSION=0.51.0
 NEWT_CFLAGS=-Os -g -fPIC
 
 $(DL_DIR)/$(NEWT_SOURCE):
-	$(call DOWNLOAD,$(NEWT_SITE),$(NEWT_SOURCE))
+	$(call DOWNLOAD,$(NEWT_SITE)/$(NEWT_SOURCE),$(NEWT_SOURCE))
 
 $(NEWT_DIR)/.source: $(DL_DIR)/$(NEWT_SOURCE)
 	$(NEWT_CAT) $(DL_DIR)/$(NEWT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/tinyhttpd/tinyhttpd.mk +1 -1
index 739849f..8f59661 100644
@@ -12,7 +12,7 @@ TINYHTTPD_BINARY:=httpd
 TINYHTTPD_TARGET_BINARY:=usr/sbin/tinyhttpd
 
 $(DL_DIR)/$(TINYHTTPD_SOURCE):
-	 $(call DOWNLOAD,$(TINYHTTPD_SITE),$(TINYHTTPD_SOURCE))
+	 $(call DOWNLOAD,$(TINYHTTPD_SITE)/$(TINYHTTPD_SOURCE),$(TINYHTTPD_SOURCE))
 
 tinyhttpd-source: $(DL_DIR)/$(TINYHTTPD_SOURCE)
 
package/ttcp/ttcp.mk +1 -1
index 006b74c..f9035e4 100644
@@ -10,7 +10,7 @@ TTCP_SOURCE=ttcp$(TTCP_VERSION).c
 TTCP_DIR=$(BUILD_DIR)/ttcp$(TTCP_VERSION)
 
 $(DL_DIR)/$(TTCP_SOURCE):
-	 $(call DOWNLOAD,$(TTCP_SOURCE_URL),$(TTCP_SOURCE))
+	 $(call DOWNLOAD,$(TTCP_SOURCE_URL)/$(TTCP_SOURCE),$(TTCP_SOURCE))
 
 $(TTCP_DIR)/.unpacked: $(DL_DIR)/$(TTCP_SOURCE)
 	-mkdir $(TTCP_DIR)
package/uemacs/uemacs.mk +1 -1
index 8355a7f..63b97b9 100644
@@ -12,7 +12,7 @@ UEMACS_BINARY:=em
 UEMACS_TARGET_BINARY:=usr/bin/emacs
 
 $(DL_DIR)/$(UEMACS_SOURCE):
-	 $(call DOWNLOAD,$(UEMACS_SITE),$(UEMACS_SOURCE))
+	 $(call DOWNLOAD,$(UEMACS_SITE)/$(UEMACS_SOURCE),$(UEMACS_SOURCE))
 
 uemacs-source: $(DL_DIR)/$(UEMACS_SOURCE)
 
package/vpnc/vpnc.mk +1 -1
index 5a8c700..00b1375 100644
@@ -15,7 +15,7 @@ VPNC_TARGET_BINARY:=$(VPNC_DEST_DIR)/vpnc
 VPNC_TARGET_SCRIPT:=$(TARGET_DIR)/etc/vpnc/default.conf
 
 $(DL_DIR)/$(VPNC_SOURCE):
-	$(call DOWNLOAD,$(VPNC_SITE),$(VPNC_SOURCE))
+	$(call DOWNLOAD,$(VPNC_SITE)/$(VPNC_SOURCE),$(VPNC_SOURCE))
 
 $(VPNC_DIR)/.unpacked: $(DL_DIR)/$(VPNC_SOURCE)
 	$(VPNC_CAT) $(DL_DIR)/$(VPNC_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/xfsprogs/xfsprogs.mk +1 -1
index 68db2f7..7c3fb01 100644
@@ -18,7 +18,7 @@ XFSPROGS_STRIP_LIBDEP:= \
 	repair/xfs_repair quota/xfs_quota
 
 $(DL_DIR)/$(XFSPROGS_SOURCE):
-	 $(call DOWNLOAD,$(XFSPROGS_SITE),$(XFSPROGS_SOURCE))
+	 $(call DOWNLOAD,$(XFSPROGS_SITE)/$(XFSPROGS_SOURCE),$(XFSPROGS_SOURCE))
 
 xfsprogs-source: $(DL_DIR)/$(XFSPROGS_SOURCE)
 
toolchain/gcc/gcc-uclibc-4.x.mk +1 -1
index 5eb7505..4938fd2 100644
@@ -172,7 +172,7 @@ endif
 
 $(DL_DIR)/$(GCC_SOURCE):
 	mkdir -p $(DL_DIR)
-	$(call DOWNLOAD,$(GCC_SITE),$(GCC_SOURCE))
+	$(call DOWNLOAD,$(GCC_SITE)/$(GCC_SOURCE),$(GCC_SOURCE))
 
 gcc-unpacked: $(GCC_DIR)/.patched
 $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
toolchain/gdb/gdb.mk +1 -1
index 56faf49..2278f2e 100644
@@ -24,7 +24,7 @@ endif
 GDB_DIR:=$(TOOLCHAIN_DIR)/gdb-$(GDB_VERSION)
 
 $(DL_DIR)/$(GDB_SOURCE):
-	$(call DOWNLOAD,$(GDB_SITE),$(GDB_SOURCE))
+	$(call DOWNLOAD,$(GDB_SITE)/$(GDB_SOURCE),$(GDB_SOURCE))
 
 gdb-unpacked: $(GDB_DIR)/.unpacked
 $(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
toolchain/kernel-headers/kernel-headers.mk +1 -1
index 72c6007..7bc7627 100644
@@ -81,7 +81,7 @@ $(DL_DIR)/$(LINUX_HEADERS_SOURCE):
 ifeq ($(BR2_KERNEL_HEADERS_SNAP),y)
 	$(error No local $@ found, cannot continue. Are you sure you wanted to enable BR2_KERNEL_HEADERS_SNAP?)
 endif
-	$(call DOWNLOAD,$(LINUX_HEADERS_SITE),$(LINUX_HEADERS_SOURCE))
+	$(call DOWNLOAD,$(LINUX_HEADERS_SITE)/$(LINUX_HEADERS_SOURCE),$(LINUX_HEADERS_SOURCE))
 
 kernel-headers: $(LINUX_HEADERS_DIR)/.configured
 
toolchain/toolchain-external/ext-tool.mk +3 -3
index 2ac4973..26f3846 100644
@@ -225,10 +225,10 @@ endif
 # components than usual.
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2010RC1),y)
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_1),$(TOOLCHAIN_EXTERNAL_SOURCE_1))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_1)/$(TOOLCHAIN_EXTERNAL_SOURCE_1),$(TOOLCHAIN_EXTERNAL_SOURCE_1))
 
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_2),$(TOOLCHAIN_EXTERNAL_SOURCE_2))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_2)/$(TOOLCHAIN_EXTERNAL_SOURCE_2),$(TOOLCHAIN_EXTERNAL_SOURCE_2))
 
 $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2)
 	mkdir -p $(@D)
@@ -251,7 +251,7 @@ endif
 else
 # Download and extraction of a toolchain
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE),$(TOOLCHAIN_EXTERNAL_SOURCE))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE)/$(TOOLCHAIN_EXTERNAL_SOURCE),$(TOOLCHAIN_EXTERNAL_SOURCE))
 
 $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE)
 	mkdir -p $(@D)
toolchain/uClibc/uclibc.mk +1 -1
index ee474bb..a8f3a96 100644
@@ -67,7 +67,7 @@ UCLIBC_ARM_TYPE:=CONFIG_$(call qstrip,$(BR2_ARM_TYPE))
 UCLIBC_SPARC_TYPE:=CONFIG_SPARC_$(call qstrip,$(BR2_SPARC_TYPE))
 
 $(DL_DIR)/$(UCLIBC_SOURCE):
-	$(call DOWNLOAD,$(UCLIBC_SITE),$(UCLIBC_SOURCE))
+	$(call DOWNLOAD,$(UCLIBC_SITE)/$(UCLIBC_SOURCE),$(UCLIBC_SOURCE))
 
 uclibc-unpacked: $(UCLIBC_DIR)/.unpacked
 $(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
Signature · 1 line
1.7.8.3
#3 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

Quoted 10 lines · On Wednesday 15 February 2012 22:05:38 Arnout Vandecappelle (Essensium/Mind)…

From: "Alvaro G. M" <[email protected]>

This patch modifies the definition of DOWNLOAD to receive two arguments.

I think this is the generic solution to the problem, even though it is a change to the API.

However, by making the second parameter optional, it could be possible to reduce code. To keep the more generic way, the .mk files that needed to be changed to the new API are kept with both arguments to the call of the function.

It would indeed be a good idea to make the second parameter optional. And
in that case, I would leave out the second parameter whenever possible.

Quoted 1 line

Same thing with the, to my knowledge, unused SOURCE_CHECK_WGET and SCP functions.

It is used for 'make source-check'.

Quoted 3 lines

The difference is that now $1 stores the full URL of the file, whereas $2 stores the name of the file as we want it to be named after download complets.

^completes

Quoted 11 lines

For example, a full copy-paste from Xilinx git:
URL='http://git.xilinx.com/?p=xldk/microblaze_v2.0_le.git;a=blob;f=microblazeel-unknown-linux-gnu.tgz;h=d7b493c5dbcc24ba9cc3be2e4c14d6d9701e6805;hb=HEAD' FILE='microblazeel-unknown-linux-gnu.tgz'

$(call DOWNLOAD,$(URL),$(FILE))

In case we know for sure the downloaded file is going to have the name we want, we can omit the second parameter:

URL=ftp://ftp.idsoftware.com/idstuff/doom/doom-$(DOOM_WAD_VERSION).wad.gz $(call DOWNLOAD,$(URL))

Sounds like a great plan!

[snip]

docs/buildroot.html

Quoted 4 lines
docs/buildroot.html +0 -0
index ddfb20a..e0f6ad8 100644

The manually maintained buildroot.html is deprecated and should be
removed Real Soon Now (Peter?).

docs/manual/adding-packages-handwritten.txt existing manual makefiles and to help understand how they work.* · line 25

Quoted 8 lines
docs/manual/adding-packages-handwritten.txt +1 -1
@@ -22,7 +22,7 @@ existing manual makefiles and to help understand how they work.*
 11: LIBFOO_TARGET_BINARY:=usr/bin/foo
 12:
 13: $(DL_DIR)/$(LIBFOO_SOURCE):
-14: 	$(call DOWNLOAD,$(LIBFOO_SITE),$(LIBFOO_SOURCE))
+14: 	$(call DOWNLOAD,$(LIBFOO_SITE)/$(LIBFOO_SOURCE),$(LIBFOO_SOURCE))

Leave out the second parameter in the example here.

linux/linux.mk define LINUX_DOWNLOAD_PATCHES · line 101

Quoted 13 lines
docs/manual/adding-packages-handwritten.txt +0 -0
 15:
 16: $(LIBFOO_DIR)/.source: $(DL_DIR)/$(LIBFOO_SOURCE)
 17: 	$(ZCAT) $(DL_DIR)/$(LIBFOO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
linux/linux.mk +1 -1
index ae236d4..d1a05a1 100644
@@ -98,7 +98,7 @@ define LINUX_DOWNLOAD_PATCHES
 	$(if $(LINUX_PATCHES),
 		@$(call MESSAGE,"Download additional patches"))
 	$(foreach patch,$(filter ftp://% http://%,$(LINUX_PATCHES)),\
-		$(call DOWNLOAD,$(dir $(patch)),$(notdir $(patch)))$(sep))
+		$(call DOWNLOAD,$(patch),$(notdir $(patch)))$(sep))

So this could become

	$(call DOWNLOAD,$(patch))$(sep))

right? That's a
tremendous improvement!

package/Makefile.package.in endef · line 206

Quoted 13 lines
linux/linux.mk +0 -0
 endef
 
 LINUX_POST_DOWNLOAD_HOOKS += LINUX_DOWNLOAD_PATCHES
package/Makefile.package.in +1 -1
index 33461b4..3714de0 100644
@@ -203,11 +203,11 @@ endef
 # to prepend the path with a slash: scp://[user@]host:/absolutepath
 define DOWNLOAD_SCP
 	test -e $(DL_DIR)/$(2) || \
-	$(SCP) $(call stripurischeme,$(call qstrip,$(1)))/$(2) $(DL_DIR)
+	$(SCP) $(call stripurischeme,$(call qstrip,$(1))) $(DL_DIR)/$(2)

While you're at it, maybe you can add quotes, i.e.

	$(SCP) '$(call stripurischeme,$(call qstrip,$(1)))' $(DL_DIR)/$(2)

Note that the second parameter doesn't have to be quoted - we do this
precisely to make sure it's a safe file.

Quoted 10 lines
package/Makefile.package.in +1 -1
 endef
 
 define SOURCE_CHECK_SCP
-	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1)/$(2),:) > /dev/null
+	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1),:) > /dev/null
 endef
 
 define SHOW_EXTERNAL_DEPS_SCP
@@ -237,12 +237,16 @@ endef
 

package/Makefile.package.in endef · line 245

Quoted 10 lines
package/Makefile.package.in +6 -2
 
 define DOWNLOAD_WGET
-	test -e $(DL_DIR)/$(2) || \
-	$(WGET) -P $(DL_DIR) $(call qstrip,$(1))/$(2)
+	if test -n "$(2)"; then \
+		test -e $(DL_DIR)/$(2) || \
+		$(WGET) -O $(DL_DIR)/$(2) $(call qstrip,$(1)); \
+	else \
+		$(WGET) $(call qstrip,$(1)) ;\
+	fi

The test should be there also when defaulting $(2). So, to make
life easier, the default should be set in the DOWNLOAD macro itself.

Also, the call to the DOWNLOAD macro in the GENTARGETS wasn't updated.
You should replace the , with a / there.

Quoted 13 lines
package/Makefile.package.in +1 -1
 endef
 
 define SOURCE_CHECK_WGET
-  $(WGET) --spider $(call qstrip,$(1))/$(2)
+  $(WGET) --spider $(call qstrip,$(1))
 endef
 
 define SHOW_EXTERNAL_DEPS_WGET
package/cups/cups.mk +0 -0
index 4e8db71..ed2e72c 100644

package/cups/cups.mk else · line 68

Quoted 5 lines
package/cups/cups.mk +1 -1
@@ -65,7 +65,7 @@ else
 endif
 
 $(DL_DIR)/$(CUPS_SOURCE):
-	 $(call DOWNLOAD,$(CUPS_SITE),$(CUPS_SOURCE))
+	 $(call DOWNLOAD,$(CUPS_SITE)/$(CUPS_SOURCE),$(CUPS_SOURCE))

As I mentioned before: use the default, remove the second $(CUPS_SOURCE).
And the same for all other packages, of course.

[snip]

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#4 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

I like your suggestions. I'll get into it this afternoon and send the new patch.

I've just learned that wget has the option --content-disposition which manages to set the right filename even in URLs like that from Xilinx. Although it seems to have some drawbacks, maybe it could be used whenever the second argument of DOWNLOAD is not defined. Should I set it then?

If this is set to on, experimental (not fully-functional) support for "Content-Disposition" headers is enabled. This can currently result in extra round-trips to the server for a "HEAD" request,
and
is known to suffer from a few bugs, which is why it is not currently enabled by default.

This option is useful for some file-downloading CGI programs that use "Content-Disposition" headers to describe what the name of a downloaded file should be.

Thanks for the send-email tip!

2012/2/16 Arnout Vandecappelle <[email protected]>

Quoted 176 lines
Quoted 8 lines · On Wednesday 15 February 2012 22:05:38 Arnout Vandecappelle (Essensium/Mind)…

From: "Alvaro G. M" <[email protected]>

This patch modifies the definition of DOWNLOAD to receive two arguments.

I think this is the generic solution to the problem, even though it is a change to the API.

However, by making the second parameter optional, it could be possible

to reduce

Quoted 1 line

code. To keep the more generic way, the .mk files that needed to be

changed

Quoted 1 line

to the new API are kept with both arguments to the call of the function.

It would indeed be a good idea to make the second parameter optional. And
in that case, I would leave out the second parameter whenever possible.

Quoted 1 line

Same thing with the, to my knowledge, unused SOURCE_CHECK_WGET and SCP

functions.

It is used for 'make source-check'.

Quoted 3 lines

The difference is that now $1 stores the full URL of the file, whereas $2 stores the name of the file as we want it to be named after download complets.

^completes

Quoted 2 lines

For example, a full copy-paste from Xilinx git:
URL='

http://git.xilinx.com/?p=xldk/microblaze_v2.0_le.git;a=blob;f=microblazeel-unknown-linux-gnu.tgz;h=d7b493c5dbcc24ba9cc3be2e4c14d6d9701e6805;hb=HEAD
'

Quoted 8 lines

FILE='microblazeel-unknown-linux-gnu.tgz'

$(call DOWNLOAD,$(URL),$(FILE))

In case we know for sure the downloaded file is going to have the name we want, we can omit the second parameter:

URL=

ftp://ftp.idsoftware.com/idstuff/doom/doom-$(DOOM_WAD_VERSION).wad.gz

Quoted 1 line

$(call DOWNLOAD,$(URL))

Sounds like a great plan!

[snip]

docs/buildroot.html

Quoted 4 lines
docs/buildroot.html +0 -0
index ddfb20a..e0f6ad8 100644

The manually maintained buildroot.html is deprecated and should be
removed Real Soon Now (Peter?).

docs/manual/adding-packages-handwritten.txt existing manual makefiles and to help understand how

Quoted 3 lines
docs/manual/adding-packages-handwritten.txt +0 -0
@@ -22,7 +22,7 @@ existing manual makefiles and to help understand how

they work.*

docs/manual/adding-packages-handwritten.txt existing manual makefiles and to help understand how they work.* · line 25

Quoted 5 lines
docs/manual/adding-packages-handwritten.txt +1 -1
 11: LIBFOO_TARGET_BINARY:=usr/bin/foo
 12:
 13: $(DL_DIR)/$(LIBFOO_SOURCE):
-14:  $(call DOWNLOAD,$(LIBFOO_SITE),$(LIBFOO_SOURCE))
+14:  $(call DOWNLOAD,$(LIBFOO_SITE)/$(LIBFOO_SOURCE),$(LIBFOO_SOURCE))

Leave out the second parameter in the example here.

docs/manual/adding-packages-handwritten.txt existing manual makefiles and to help understand how they work.*

Quoted 3 lines
docs/manual/adding-packages-handwritten.txt +0 -0
 15:
 16: $(LIBFOO_DIR)/.source: $(DL_DIR)/$(LIBFOO_SOURCE)
 17:  $(ZCAT) $(DL_DIR)/$(LIBFOO_SOURCE) | tar -C $(BUILD_DIR)

$(TAR_OPTIONS) -

linux/linux.mk define LINUX_DOWNLOAD_PATCHES · line 101

Quoted 10 lines
linux/linux.mk +1 -1
index ae236d4..d1a05a1 100644
@@ -98,7 +98,7 @@ define LINUX_DOWNLOAD_PATCHES
      $(if $(LINUX_PATCHES),
              @$(call MESSAGE,"Download additional patches"))
      $(foreach patch,$(filter ftp://% http://%,$(LINUX_PATCHES)),\
-             $(call DOWNLOAD,$(dir $(patch)),$(notdir $(patch)))$(sep))
+             $(call DOWNLOAD,$(patch),$(notdir $(patch)))$(sep))

So this could become

       $(call DOWNLOAD,$(patch))$(sep))

right? That's a
tremendous improvement!

package/Makefile.package.in endef · line 206

Quoted 13 lines
linux/linux.mk +0 -0
 endef
 
 LINUX_POST_DOWNLOAD_HOOKS += LINUX_DOWNLOAD_PATCHES
package/Makefile.package.in +1 -1
index 33461b4..3714de0 100644
@@ -203,11 +203,11 @@ endef
 # to prepend the path with a slash: scp://[user@]host:/absolutepath
 define DOWNLOAD_SCP
      test -e $(DL_DIR)/$(2) || \
-     $(SCP) $(call stripurischeme,$(call qstrip,$(1)))/$(2) $(DL_DIR)
+     $(SCP) $(call stripurischeme,$(call qstrip,$(1))) $(DL_DIR)/$(2)

While you're at it, maybe you can add quotes, i.e.

        $(SCP) '$(call stripurischeme,$(call qstrip,$(1)))' $(DL_DIR)/$(2)

Note that the second parameter doesn't have to be quoted - we do this
precisely to make sure it's a safe file.

package/Makefile.package.in endef

Quoted 4 lines
package/Makefile.package.in +0 -1
 endef
 
 define SOURCE_CHECK_SCP
-     $(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1)/$(2),:) >

/dev/null

package/Makefile.package.in endef · line 210

Quoted 1 line
package/Makefile.package.in +1 -0
+     $(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1),:) >

/dev/null

Quoted 5 lines
package/Makefile.package.in +0 -0
 endef
 
 define SHOW_EXTERNAL_DEPS_SCP
@@ -237,12 +237,16 @@ endef
 

package/Makefile.package.in endef · line 245

Quoted 10 lines
package/Makefile.package.in +6 -2
 
 define DOWNLOAD_WGET
-     test -e $(DL_DIR)/$(2) || \
-     $(WGET) -P $(DL_DIR) $(call qstrip,$(1))/$(2)
+     if test -n "$(2)"; then \
+             test -e $(DL_DIR)/$(2) || \
+             $(WGET) -O $(DL_DIR)/$(2) $(call qstrip,$(1)); \
+     else \
+             $(WGET) $(call qstrip,$(1)) ;\
+     fi

The test should be there also when defaulting $(2). So, to make
life easier, the default should be set in the DOWNLOAD macro itself.

Also, the call to the DOWNLOAD macro in the GENTARGETS wasn't updated.
You should replace the , with a / there.

Quoted 13 lines
package/Makefile.package.in +1 -1
 endef
 
 define SOURCE_CHECK_WGET
-  $(WGET) --spider $(call qstrip,$(1))/$(2)
+  $(WGET) --spider $(call qstrip,$(1))
 endef
 
 define SHOW_EXTERNAL_DEPS_WGET
package/cups/cups.mk +0 -0
index 4e8db71..ed2e72c 100644

package/cups/cups.mk else · line 68

Quoted 5 lines
package/cups/cups.mk +1 -1
@@ -65,7 +65,7 @@ else
 endif
 
 $(DL_DIR)/$(CUPS_SOURCE):
-      $(call DOWNLOAD,$(CUPS_SITE),$(CUPS_SOURCE))
+      $(call DOWNLOAD,$(CUPS_SITE)/$(CUPS_SOURCE),$(CUPS_SOURCE))

As I mentioned before: use the default, remove the second $(CUPS_SOURCE).
And the same for all other packages, of course.

[snip]

Regards,
Arnout

--

Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR
Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
Signature · 4 lines
?lvaro G?mez Machado
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120216/f92eb632/attachment.html>
#5 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

Quoted 4 lines · On Thursday 16 February 2012 09:31:51 Alvaro Gamez wrote:

I've just learned that wget has the option --content-disposition which manages to set the right filename even in URLs like that from Xilinx. Although it seems to have some drawbacks, maybe it could be used whenever the second argument of DOWNLOAD is not defined. Should I set it then?

Doesn't help much, because there's no guarantee that the downloaded
filename is what the buildroot makefiles expect it to be.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#6 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

In reply to Arnout Vandecappelle

From: "Alvaro G. M." <[email protected]>

This modifies the definition of DOWNLOAD to receive two arguments:
the first one is the full URL of the file to download, whereas the second (and optional) is the name the file will have once downloaded.

Same thing with the SOURCE_CHECK_WGET and SCP functions.

All calls to these functions have been changed to the shortest form of the new API.

---
 docs/manual/adding-packages-handwritten.txt |    2 +-
 linux/linux.mk                              |    2 +-
 package/Makefile.package.in                 |   23 ++++++++++++++---------
 package/cups/cups.mk                        |    2 +-
 package/fis/fis.mk                          |    2 +-
 package/games/doom-wad/doom-wads.mk         |    2 +-
 package/gettext/gettext.mk                  |    2 +-
 package/microperl/microperl.mk              |    2 +-
 package/netkitbase/netkitbase.mk            |    2 +-
 package/netkittelnet/netkittelnet.mk        |    2 +-
 package/newt/newt.mk                        |    2 +-
 package/tinyhttpd/tinyhttpd.mk              |    2 +-
 package/ttcp/ttcp.mk                        |    2 +-
 package/uemacs/uemacs.mk                    |    2 +-
 package/vpnc/vpnc.mk                        |    2 +-
 package/xfsprogs/xfsprogs.mk                |    2 +-
 toolchain/gcc/gcc-uclibc-4.x.mk             |    2 +-
 toolchain/gdb/gdb.mk                        |    2 +-
 toolchain/kernel-headers/kernel-headers.mk  |    2 +-
 toolchain/toolchain-external/ext-tool.mk    |    6 +++---
 toolchain/uClibc/uclibc.mk                  |    2 +-
 21 files changed, 36 insertions(+), 31 deletions(-)
docs/manual/adding-packages-handwritten.txt +1 -1
index a9d247c..583f303 100644
@@ -22,7 +22,7 @@ existing manual makefiles and to help understand how they work.*
 11: LIBFOO_TARGET_BINARY:=usr/bin/foo
 12:
 13: $(DL_DIR)/$(LIBFOO_SOURCE):
-14: 	$(call DOWNLOAD,$(LIBFOO_SITE),$(LIBFOO_SOURCE))
+14: 	$(call DOWNLOAD,$(LIBFOO_SITE)/$(LIBFOO_SOURCE))
 15:
 16: $(LIBFOO_DIR)/.source: $(DL_DIR)/$(LIBFOO_SOURCE)
 17: 	$(ZCAT) $(DL_DIR)/$(LIBFOO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
linux/linux.mk +1 -1
index ae236d4..58cbe8e 100644
@@ -98,7 +98,7 @@ define LINUX_DOWNLOAD_PATCHES
 	$(if $(LINUX_PATCHES),
 		@$(call MESSAGE,"Download additional patches"))
 	$(foreach patch,$(filter ftp://% http://%,$(LINUX_PATCHES)),\
-		$(call DOWNLOAD,$(dir $(patch)),$(notdir $(patch)))$(sep))
+		$(call DOWNLOAD,$(patch))$(sep))
 endef
 
 LINUX_POST_DOWNLOAD_HOOKS += LINUX_DOWNLOAD_PATCHES
package/Makefile.package.in +14 -9
index 33461b4..78fe3cc 100644
@@ -203,11 +203,11 @@ endef
 # to prepend the path with a slash: scp://[user@]host:/absolutepath
 define DOWNLOAD_SCP
 	test -e $(DL_DIR)/$(2) || \
-	$(SCP) $(call stripurischeme,$(call qstrip,$(1)))/$(2) $(DL_DIR)
+	$(SCP) '$(call stripurischeme,$(call qstrip,$(1)))' $(DL_DIR)/$(2)
 endef
 
 define SOURCE_CHECK_SCP
-	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1)/$(2),:) > /dev/null
+	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1),:) > /dev/null
 endef
 
 define SHOW_EXTERNAL_DEPS_SCP
@@ -237,12 +237,17 @@ endef
 
 
 define DOWNLOAD_WGET
-	test -e $(DL_DIR)/$(2) || \
-	$(WGET) -P $(DL_DIR) $(call qstrip,$(1))/$(2)
+	if test -n "$(2)"; then \
+		test -e $(DL_DIR)/$(2) || \
+		$(WGET) -O $(DL_DIR)/$(2) $(call qstrip,$(1)); \
+	else \
+		test -e $(DL_DIR)/$(call notdir,$(1)) || \
+		$(WGET) -P $(DL_DIR) $(call qstrip,$(1)) ;\
+	fi
 endef
 
 define SOURCE_CHECK_WGET
-  $(WGET) --spider $(call qstrip,$(1))/$(2)
+  $(WGET) --spider $(call qstrip,$(1))
 endef
 
 define SHOW_EXTERNAL_DEPS_WGET
@@ -290,11 +295,11 @@ define DOWNLOAD
 			file) $($(DL_MODE)_LOCALFILES) && exit ;; \
 			scp) $($(DL_MODE)_SCP) && exit ;; \
 			hg) $($(DL_MODE)_HG) && exit ;; \
-			*) $(call $(DL_MODE)_WGET,$(1),$(2)) && exit ;; \
+			*) if test -n "$(2)" ; then $(call $(DL_MODE)_WGET,$(1)/$(2),$(2)); else $(call $(DL_MODE)_WGET,$(1)); fi && exit ;; \
 		esac ; \
 	fi ; \
 	if test -n "$(call qstrip,$(BR2_BACKUP_SITE))" ; then \
-		$(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE),$(2)) && exit ; \
+		$(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE)/$(2),$(2)) && exit ; \
 	fi ; \
 	exit 1
 endef
@@ -318,8 +323,8 @@ ifeq ($(DL_MODE),DOWNLOAD)
 		(test -z $($(PKG)_PATCH) || test -e $(DL_DIR)$($(PKG)_PATCH))) || \
 		$(call MESSAGE,"Downloading")
 endif
-	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_SOURCE)))
-	$(if $($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_PATCH)))
+	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
+	$(if $($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_PATCH)))
 	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
 ifeq ($(DL_MODE),DOWNLOAD)
 	$(Q)mkdir -p $(@D)
package/cups/cups.mk +1 -1
index 4e8db71..9efd6e9 100644
@@ -65,7 +65,7 @@ else
 endif
 
 $(DL_DIR)/$(CUPS_SOURCE):
-	 $(call DOWNLOAD,$(CUPS_SITE),$(CUPS_SOURCE))
+	 $(call DOWNLOAD,$(CUPS_SITE)/$(CUPS_SOURCE))
 
 $(CUPS_DIR)/.unpacked: $(DL_DIR)/$(CUPS_SOURCE)
 	$(CUPS_CAT) $(DL_DIR)/$(CUPS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/fis/fis.mk +1 -1
index 2942449..0975f3f 100644
@@ -11,7 +11,7 @@ FIS_BINARY:=fis
 FIS_TARGET_BINARY:=sbin/fis
 
 $(DL_DIR)/$(FIS_SOURCE):
-	 $(call DOWNLOAD,$(FIS_SITE),$(FIS_SOURCE))
+	 $(call DOWNLOAD,$(FIS_SITE)/$(FIS_SOURCE))
 
 fis-source: $(DL_DIR)/$(FIS_SOURCE)
 
package/games/doom-wad/doom-wads.mk +1 -1
index bae2420..c0bf4fb 100644
@@ -10,7 +10,7 @@ DOOM_WAD_SITE = ftp://ftp.idsoftware.com/idstuff/doom/
 DOOM_WAD_DIR=$(BUILD_DIR)/doom-wad-$(DOOM_WAD_VERSION)
 
 $(DL_DIR)/$(DOOM_WAD_SOURCE):
-	 $(call DOWNLOAD,$(DOOM_WAD_SITE),$(DOOM_WAD_SOURCE))
+	 $(call DOWNLOAD,$(DOOM_WAD_SITE)/$(DOOM_WAD_SOURCE))
 
 doom-wad-source: $(DL_DIR)/$(DOOM_WAD_SOURCE)
 
package/gettext/gettext.mk +1 -1
index f4c8c76..f3605da 100644
@@ -18,7 +18,7 @@ LIBINTL_TARGET_BINARY:=usr/lib/libintl.so
 endif
 
 $(DL_DIR)/$(GETTEXT_SOURCE):
-	 $(call DOWNLOAD,$(GETTEXT_SITE),$(GETTEXT_SOURCE))
+	 $(call DOWNLOAD,$(GETTEXT_SITE)/$(GETTEXT_SOURCE))
 
 gettext-source: $(DL_DIR)/$(GETTEXT_SOURCE)
 
package/microperl/microperl.mk +1 -1
index b68e825..ae442a0 100644
@@ -18,7 +18,7 @@ MICROPERL_MODS+=File/Basename.pm Errno.pm Config.pm IO/File.pm Symbol.pm \
 	DynaLoader.pm AutoLoader.pm Carp/Heavy.pm
 endif
 $(DL_DIR)/$(MICROPERL_SOURCE):
-	$(call DOWNLOAD,$(MICROPERL_SITE),$(MICROPERL_SOURCE))
+	$(call DOWNLOAD,$(MICROPERL_SITE)/$(MICROPERL_SOURCE))
 
 $(MICROPERL_DIR)/.source: $(DL_DIR)/$(MICROPERL_SOURCE)
 	$(MICROPERL_CAT) $(DL_DIR)/$(MICROPERL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/netkitbase/netkitbase.mk +1 -1
index dde8f9f..83991f2 100644
@@ -12,7 +12,7 @@ NETKITBASE_BINARY:=inetd/inetd
 NETKITBASE_TARGET_BINARY:=usr/sbin/inetd
 
 $(DL_DIR)/$(NETKITBASE_SOURCE):
-	 $(call DOWNLOAD,$(NETKITBASE_SITE),$(NETKITBASE_SOURCE))
+	 $(call DOWNLOAD,$(NETKITBASE_SITE)/$(NETKITBASE_SOURCE))
 
 netkitbase-source: $(DL_DIR)/$(NETKITBASE_SOURCE)
 
package/netkittelnet/netkittelnet.mk +1 -1
index e9f40ca..ff05318 100644
@@ -12,7 +12,7 @@ NETKITTELNET_BINARY:=telnetd/telnetd
 NETKITTELNET_TARGET_BINARY:=usr/sbin/telnetd
 
 $(DL_DIR)/$(NETKITTELNET_SOURCE):
-	 $(call DOWNLOAD,$(NETKITTELNET_SITE),$(NETKITTELNET_SOURCE))
+	 $(call DOWNLOAD,$(NETKITTELNET_SITE)/$(NETKITTELNET_SOURCE))
 
 netkittelnet-source: $(DL_DIR)/$(NETKITTELNET_SOURCE)
 
package/newt/newt.mk +1 -1
index eb944a9..ac450e0 100644
@@ -11,7 +11,7 @@ NEWT_VERSION=0.51.0
 NEWT_CFLAGS=-Os -g -fPIC
 
 $(DL_DIR)/$(NEWT_SOURCE):
-	$(call DOWNLOAD,$(NEWT_SITE),$(NEWT_SOURCE))
+	$(call DOWNLOAD,$(NEWT_SITE)/$(NEWT_SOURCE))
 
 $(NEWT_DIR)/.source: $(DL_DIR)/$(NEWT_SOURCE)
 	$(NEWT_CAT) $(DL_DIR)/$(NEWT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/tinyhttpd/tinyhttpd.mk +1 -1
index 739849f..0f95d06 100644
@@ -12,7 +12,7 @@ TINYHTTPD_BINARY:=httpd
 TINYHTTPD_TARGET_BINARY:=usr/sbin/tinyhttpd
 
 $(DL_DIR)/$(TINYHTTPD_SOURCE):
-	 $(call DOWNLOAD,$(TINYHTTPD_SITE),$(TINYHTTPD_SOURCE))
+	 $(call DOWNLOAD,$(TINYHTTPD_SITE)/$(TINYHTTPD_SOURCE))
 
 tinyhttpd-source: $(DL_DIR)/$(TINYHTTPD_SOURCE)
 
package/ttcp/ttcp.mk +1 -1
index 006b74c..1acf120 100644
@@ -10,7 +10,7 @@ TTCP_SOURCE=ttcp$(TTCP_VERSION).c
 TTCP_DIR=$(BUILD_DIR)/ttcp$(TTCP_VERSION)
 
 $(DL_DIR)/$(TTCP_SOURCE):
-	 $(call DOWNLOAD,$(TTCP_SOURCE_URL),$(TTCP_SOURCE))
+	 $(call DOWNLOAD,$(TTCP_SOURCE_URL)/$(TTCP_SOURCE))
 
 $(TTCP_DIR)/.unpacked: $(DL_DIR)/$(TTCP_SOURCE)
 	-mkdir $(TTCP_DIR)
package/uemacs/uemacs.mk +1 -1
index 8355a7f..62b0911 100644
@@ -12,7 +12,7 @@ UEMACS_BINARY:=em
 UEMACS_TARGET_BINARY:=usr/bin/emacs
 
 $(DL_DIR)/$(UEMACS_SOURCE):
-	 $(call DOWNLOAD,$(UEMACS_SITE),$(UEMACS_SOURCE))
+	 $(call DOWNLOAD,$(UEMACS_SITE)/$(UEMACS_SOURCE))
 
 uemacs-source: $(DL_DIR)/$(UEMACS_SOURCE)
 
package/vpnc/vpnc.mk +1 -1
index 5a8c700..d8d9654 100644
@@ -15,7 +15,7 @@ VPNC_TARGET_BINARY:=$(VPNC_DEST_DIR)/vpnc
 VPNC_TARGET_SCRIPT:=$(TARGET_DIR)/etc/vpnc/default.conf
 
 $(DL_DIR)/$(VPNC_SOURCE):
-	$(call DOWNLOAD,$(VPNC_SITE),$(VPNC_SOURCE))
+	$(call DOWNLOAD,$(VPNC_SITE)/$(VPNC_SOURCE))
 
 $(VPNC_DIR)/.unpacked: $(DL_DIR)/$(VPNC_SOURCE)
 	$(VPNC_CAT) $(DL_DIR)/$(VPNC_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/xfsprogs/xfsprogs.mk +1 -1
index 68db2f7..52fec09 100644
@@ -18,7 +18,7 @@ XFSPROGS_STRIP_LIBDEP:= \
 	repair/xfs_repair quota/xfs_quota
 
 $(DL_DIR)/$(XFSPROGS_SOURCE):
-	 $(call DOWNLOAD,$(XFSPROGS_SITE),$(XFSPROGS_SOURCE))
+	 $(call DOWNLOAD,$(XFSPROGS_SITE)/$(XFSPROGS_SOURCE))
 
 xfsprogs-source: $(DL_DIR)/$(XFSPROGS_SOURCE)
 
toolchain/gcc/gcc-uclibc-4.x.mk +1 -1
index 5eb7505..d9547fb 100644
@@ -172,7 +172,7 @@ endif
 
 $(DL_DIR)/$(GCC_SOURCE):
 	mkdir -p $(DL_DIR)
-	$(call DOWNLOAD,$(GCC_SITE),$(GCC_SOURCE))
+	$(call DOWNLOAD,$(GCC_SITE)/$(GCC_SOURCE))
 
 gcc-unpacked: $(GCC_DIR)/.patched
 $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
toolchain/gdb/gdb.mk +1 -1
index 56faf49..b5c085b 100644
@@ -24,7 +24,7 @@ endif
 GDB_DIR:=$(TOOLCHAIN_DIR)/gdb-$(GDB_VERSION)
 
 $(DL_DIR)/$(GDB_SOURCE):
-	$(call DOWNLOAD,$(GDB_SITE),$(GDB_SOURCE))
+	$(call DOWNLOAD,$(GDB_SITE)/$(GDB_SOURCE))
 
 gdb-unpacked: $(GDB_DIR)/.unpacked
 $(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
toolchain/kernel-headers/kernel-headers.mk +1 -1
index 72c6007..c464c37 100644
@@ -81,7 +81,7 @@ $(DL_DIR)/$(LINUX_HEADERS_SOURCE):
 ifeq ($(BR2_KERNEL_HEADERS_SNAP),y)
 	$(error No local $@ found, cannot continue. Are you sure you wanted to enable BR2_KERNEL_HEADERS_SNAP?)
 endif
-	$(call DOWNLOAD,$(LINUX_HEADERS_SITE),$(LINUX_HEADERS_SOURCE))
+	$(call DOWNLOAD,$(LINUX_HEADERS_SITE)/$(LINUX_HEADERS_SOURCE))
 
 kernel-headers: $(LINUX_HEADERS_DIR)/.configured
 
toolchain/toolchain-external/ext-tool.mk +3 -3
index 2ac4973..8f75fcf 100644
@@ -225,10 +225,10 @@ endif
 # components than usual.
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2010RC1),y)
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_1),$(TOOLCHAIN_EXTERNAL_SOURCE_1))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_1)/$(TOOLCHAIN_EXTERNAL_SOURCE_1))
 
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_2),$(TOOLCHAIN_EXTERNAL_SOURCE_2))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_2)/$(TOOLCHAIN_EXTERNAL_SOURCE_2))
 
 $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2)
 	mkdir -p $(@D)
@@ -251,7 +251,7 @@ endif
 else
 # Download and extraction of a toolchain
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE),$(TOOLCHAIN_EXTERNAL_SOURCE))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE)/$(TOOLCHAIN_EXTERNAL_SOURCE))
 
 $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE)
 	mkdir -p $(@D)
toolchain/uClibc/uclibc.mk +1 -1
index ee474bb..32cbe46 100644
@@ -67,7 +67,7 @@ UCLIBC_ARM_TYPE:=CONFIG_$(call qstrip,$(BR2_ARM_TYPE))
 UCLIBC_SPARC_TYPE:=CONFIG_SPARC_$(call qstrip,$(BR2_SPARC_TYPE))
 
 $(DL_DIR)/$(UCLIBC_SOURCE):
-	$(call DOWNLOAD,$(UCLIBC_SITE),$(UCLIBC_SOURCE))
+	$(call DOWNLOAD,$(UCLIBC_SITE)/$(UCLIBC_SOURCE))
 
 uclibc-unpacked: $(UCLIBC_DIR)/.unpacked
 $(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
Signature · 1 line
1.7.9
#7 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

package/Makefile.package.in define DOWNLOAD · line 304

Quoted 13 lines · On Thursday 16 February 2012 19:15:07 Alvaro G. M wrote:
package/Makefile.package.in +2 -2
@@ -290,11 +295,11 @@ define DOWNLOAD
                        file) $($(DL_MODE)_LOCALFILES) && exit ;; \
                        scp) $($(DL_MODE)_SCP) && exit ;; \
                        hg) $($(DL_MODE)_HG) && exit ;; \
-                       *) $(call $(DL_MODE)_WGET,$(1),$(2)) && exit ;; \
+                       *) if test -n "$(2)" ; then $(call $(DL_MODE)_WGET,$(1)/$(2),$(2)); else $(call $(DL_MODE)_WGET,$(1)); fi && exit ;; \
                esac ; \
        fi ; \
        if test -n "$(call qstrip,$(BR2_BACKUP_SITE))" ; then \
-               $(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE),$(2)) && exit ; \
+               $(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE)/$(2),$(2)) && exit ; \
        fi ; \
        exit 1

No, I still don't like it I'm afraid. It feels too complicated. And I
don't think it works for the PRIMARY and BACKUP site if $(2) is empty.

How about this:

define DOWNLOAD_WGET

	test -e $(DL_DIR)/$(2) || \
	$(WGET) -O $(DL_DIR)/$(2) '$(call qstrip,$(1))'

endef

...

define DOWNLOAD

	$(call DOWNLOAD_INNER,$(1),$(if $(2),$(2),$(notdir $(1))))

endef

define DOWNLOAD_INNER

	$(Q)if test -n "$(call qstrip,$(BR2_PRIMARY_SITE))" ; then \
		case "$(call geturischeme,$(BR2_PRIMARY_SITE))" in \
			scp) $(call $(DL_MODE)_SCP,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
			*) $(call $(DL_MODE)_WGET,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
		esac ; \
	fi ; \
	if test -n "$(1)" ; then \
		case "$($(PKG)_SITE_METHOD)" in \
			git) $($(DL_MODE)_GIT) && exit ;; \
			svn) $($(DL_MODE)_SVN) && exit ;; \
			bzr) $($(DL_MODE)_BZR) && exit ;; \
			file) $($(DL_MODE)_LOCALFILES) && exit ;; \
			scp) $($(DL_MODE)_SCP) && exit ;; \
			hg) $($(DL_MODE)_HG) && exit ;; \
			*) $(call $(DL_MODE)_WGET,$(1),$(2)) && exit ;; \
		esac ; \
	fi ; \
	if test -n "$(call qstrip,$(BR2_BACKUP_SITE))" ; then \
		$(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE)/$(2),$(2)) && exit ; \
	fi ; \
	exit 1

endef

Regards,
Arnout

PS. If you do take this over, you probably better add my

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#8 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

Yours seems like more future sighted and simplifies the long "if test" I put on the call to WGET, so I'll probably use your idea after testing with the remaining patch.

Also, I didn't know one could do $(if $(2),$(2),$(notdir $(1)))), my make skills are pretty basic.

Regards

2012/2/16 Arnout Vandecappelle <[email protected]>

Quoted 78 lines · On Thursday 16 February 2012 19:15:07 Alvaro G. M wrote:

package/Makefile.package.in define DOWNLOAD · line 298

Quoted 6 lines
package/Makefile.package.in +1 -1
@@ -290,11 +295,11 @@ define DOWNLOAD
                        file) $($(DL_MODE)_LOCALFILES) && exit ;; \
                        scp) $($(DL_MODE)_SCP) && exit ;; \
                        hg) $($(DL_MODE)_HG) && exit ;; \
-                       *) $(call $(DL_MODE)_WGET,$(1),$(2)) && exit ;; \
+                       *) if test -n "$(2)" ; then $(call

$(DL_MODE)_WGET,$(1)/$(2),$(2)); else $(call $(DL_MODE)_WGET,$(1)); fi && exit ;; \

package/Makefile.package.in define DOWNLOAD

Quoted 4 lines
package/Makefile.package.in +0 -1
                esac ; \
        fi ; \
        if test -n "$(call qstrip,$(BR2_BACKUP_SITE))" ; then \
-               $(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE),$(2)) && exit

; \

Review define DOWNLOAD · line 302

Quoted 1 line
(quoted diff) +1 -0
+               $(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE)/$(2),$(2)) &&

exit ; \

Review define DOWNLOAD · line 304

Quoted 2 lines
(quoted diff) +0 -0
        fi ; \
        exit 1

No, I still don't like it I'm afraid. It feels too complicated. And I
don't think it works for the PRIMARY and BACKUP site if $(2) is empty.

How about this:

define DOWNLOAD_WGET

       test -e $(DL_DIR)/$(2) || \
       $(WGET) -O $(DL_DIR)/$(2) '$(call qstrip,$(1))'

endef

...

define DOWNLOAD

       $(call DOWNLOAD_INNER,$(1),$(if $(2),$(2),$(notdir $(1))))

endef

define DOWNLOAD_INNER

       $(Q)if test -n "$(call qstrip,$(BR2_PRIMARY_SITE))" ; then \
               case "$(call geturischeme,$(BR2_PRIMARY_SITE))" in \
                       scp) $(call
$(DL_MODE)_SCP,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
                       *) $(call
$(DL_MODE)_WGET,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
               esac ; \
       fi ; \
       if test -n "$(1)" ; then \
               case "$($(PKG)_SITE_METHOD)" in \
                       git) $($(DL_MODE)_GIT) && exit ;; \
                       svn) $($(DL_MODE)_SVN) && exit ;; \
                       bzr) $($(DL_MODE)_BZR) && exit ;; \
                        file) $($(DL_MODE)_LOCALFILES) && exit ;; \
                       scp) $($(DL_MODE)_SCP) && exit ;; \
                       hg) $($(DL_MODE)_HG) && exit ;; \
                        *) $(call $(DL_MODE)_WGET,$(1),$(2)) && exit ;; \
                esac ; \
       fi ; \
       if test -n "$(call qstrip,$(BR2_BACKUP_SITE))" ; then \
                $(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE)/$(2),$(2)) &&
exit ; \
       fi ; \
       exit 1

endef

Regards,
Arnout

PS. If you do take this over, you probably better add my

--

Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR
Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
Signature · 4 lines
?lvaro G?mez Machado
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120217/518d2d8e/attachment.html>
#9 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

Quoted 2 lines · On Friday 17 February 2012 09:27:34 Alvaro Gamez wrote:

Also, I didn't know one could do $(if $(2),$(2),$(notdir $(1)))), my make skills are pretty basic.

I didn't test this, this is just based on looking at the make manual :-)
Better check if it indeed does work.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#10 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

From: "Alvaro G. M" <[email protected]>

This modifies the definition of DOWNLOAD to receive two arguments:
the first one is the full URL of the file to download, whereas the second (and optional) is the name the file will have once downloaded.

Same thing with the SOURCE_CHECK_WGET and SCP functions.

All calls to these functions have been changed to the shortest form of the new API.

---
 docs/manual/adding-packages-handwritten.txt |    2 +-
 linux/linux.mk                              |    2 +-
 package/Makefile.package.in                 |   18 +++++++++++-------
 package/cups/cups.mk                        |    2 +-
 package/fis/fis.mk                          |    2 +-
 package/games/doom-wad/doom-wads.mk         |    2 +-
 package/gettext/gettext.mk                  |    2 +-
 package/microperl/microperl.mk              |    2 +-
 package/netkitbase/netkitbase.mk            |    2 +-
 package/netkittelnet/netkittelnet.mk        |    2 +-
 package/newt/newt.mk                        |    2 +-
 package/tinyhttpd/tinyhttpd.mk              |    2 +-
 package/ttcp/ttcp.mk                        |    2 +-
 package/uemacs/uemacs.mk                    |    2 +-
 package/vpnc/vpnc.mk                        |    2 +-
 package/xfsprogs/xfsprogs.mk                |    2 +-
 toolchain/gcc/gcc-uclibc-4.x.mk             |    2 +-
 toolchain/gdb/gdb.mk                        |    2 +-
 toolchain/kernel-headers/kernel-headers.mk  |    2 +-
 toolchain/toolchain-external/ext-tool.mk    |    6 +++---
 toolchain/uClibc/uclibc.mk                  |    2 +-
 21 files changed, 33 insertions(+), 29 deletions(-)
docs/manual/adding-packages-handwritten.txt +1 -1
index a9d247c..583f303 100644
@@ -22,7 +22,7 @@ existing manual makefiles and to help understand how they work.*
 11: LIBFOO_TARGET_BINARY:=usr/bin/foo
 12:
 13: $(DL_DIR)/$(LIBFOO_SOURCE):
-14: 	$(call DOWNLOAD,$(LIBFOO_SITE),$(LIBFOO_SOURCE))
+14: 	$(call DOWNLOAD,$(LIBFOO_SITE)/$(LIBFOO_SOURCE))
 15:
 16: $(LIBFOO_DIR)/.source: $(DL_DIR)/$(LIBFOO_SOURCE)
 17: 	$(ZCAT) $(DL_DIR)/$(LIBFOO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
linux/linux.mk +1 -1
index ae236d4..58cbe8e 100644
@@ -98,7 +98,7 @@ define LINUX_DOWNLOAD_PATCHES
 	$(if $(LINUX_PATCHES),
 		@$(call MESSAGE,"Download additional patches"))
 	$(foreach patch,$(filter ftp://% http://%,$(LINUX_PATCHES)),\
-		$(call DOWNLOAD,$(dir $(patch)),$(notdir $(patch)))$(sep))
+		$(call DOWNLOAD,$(patch))$(sep))
 endef
 
 LINUX_POST_DOWNLOAD_HOOKS += LINUX_DOWNLOAD_PATCHES
package/Makefile.package.in +11 -7
index 33461b4..a96031e 100644
@@ -203,11 +203,11 @@ endef
 # to prepend the path with a slash: scp://[user@]host:/absolutepath
 define DOWNLOAD_SCP
 	test -e $(DL_DIR)/$(2) || \
-	$(SCP) $(call stripurischeme,$(call qstrip,$(1)))/$(2) $(DL_DIR)
+	$(SCP) '$(call stripurischeme,$(call qstrip,$(1)))' $(DL_DIR)/$(2)
 endef
 
 define SOURCE_CHECK_SCP
-	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1)/$(2),:) > /dev/null
+	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1),:) > /dev/null
 endef
 
 define SHOW_EXTERNAL_DEPS_SCP
@@ -238,11 +238,11 @@ endef
 
 define DOWNLOAD_WGET
 	test -e $(DL_DIR)/$(2) || \
-	$(WGET) -P $(DL_DIR) $(call qstrip,$(1))/$(2)
+	$(WGET) -O $(DL_DIR)/$(2) '$(call qstrip,$(1))'
 endef
 
 define SOURCE_CHECK_WGET
-  $(WGET) --spider $(call qstrip,$(1))/$(2)
+  $(WGET) --spider $(call qstrip,$(1))
 endef
 
 define SHOW_EXTERNAL_DEPS_WGET
@@ -276,6 +276,10 @@ endef
 ################################################################################
 
 define DOWNLOAD
+	$(call DOWNLOAD_INNER,$(1),$(if $(2),$(2),$(notdir $(1))))
+endef
+
+define DOWNLOAD_INNER
 	$(Q)if test -n "$(call qstrip,$(BR2_PRIMARY_SITE))" ; then \
 		case "$(call geturischeme,$(BR2_PRIMARY_SITE))" in \
 			scp) $(call $(DL_MODE)_SCP,$(BR2_PRIMARY_SITE),$(2)) && exit ;; \
@@ -294,7 +298,7 @@ define DOWNLOAD
 		esac ; \
 	fi ; \
 	if test -n "$(call qstrip,$(BR2_BACKUP_SITE))" ; then \
-		$(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE),$(2)) && exit ; \
+		$(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE)/$(2),$(2)) && exit ; \
 	fi ; \
 	exit 1
 endef
@@ -318,8 +322,8 @@ ifeq ($(DL_MODE),DOWNLOAD)
 		(test -z $($(PKG)_PATCH) || test -e $(DL_DIR)$($(PKG)_PATCH))) || \
 		$(call MESSAGE,"Downloading")
 endif
-	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_SOURCE)))
-	$(if $($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_PATCH)))
+	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
+	$(if $($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_PATCH)))
 	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
 ifeq ($(DL_MODE),DOWNLOAD)
 	$(Q)mkdir -p $(@D)
package/cups/cups.mk +1 -1
index 4e8db71..9efd6e9 100644
@@ -65,7 +65,7 @@ else
 endif
 
 $(DL_DIR)/$(CUPS_SOURCE):
-	 $(call DOWNLOAD,$(CUPS_SITE),$(CUPS_SOURCE))
+	 $(call DOWNLOAD,$(CUPS_SITE)/$(CUPS_SOURCE))
 
 $(CUPS_DIR)/.unpacked: $(DL_DIR)/$(CUPS_SOURCE)
 	$(CUPS_CAT) $(DL_DIR)/$(CUPS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/fis/fis.mk +1 -1
index 2942449..0975f3f 100644
@@ -11,7 +11,7 @@ FIS_BINARY:=fis
 FIS_TARGET_BINARY:=sbin/fis
 
 $(DL_DIR)/$(FIS_SOURCE):
-	 $(call DOWNLOAD,$(FIS_SITE),$(FIS_SOURCE))
+	 $(call DOWNLOAD,$(FIS_SITE)/$(FIS_SOURCE))
 
 fis-source: $(DL_DIR)/$(FIS_SOURCE)
 
package/games/doom-wad/doom-wads.mk +1 -1
index bae2420..c0bf4fb 100644
@@ -10,7 +10,7 @@ DOOM_WAD_SITE = ftp://ftp.idsoftware.com/idstuff/doom/
 DOOM_WAD_DIR=$(BUILD_DIR)/doom-wad-$(DOOM_WAD_VERSION)
 
 $(DL_DIR)/$(DOOM_WAD_SOURCE):
-	 $(call DOWNLOAD,$(DOOM_WAD_SITE),$(DOOM_WAD_SOURCE))
+	 $(call DOWNLOAD,$(DOOM_WAD_SITE)/$(DOOM_WAD_SOURCE))
 
 doom-wad-source: $(DL_DIR)/$(DOOM_WAD_SOURCE)
 
package/gettext/gettext.mk +1 -1
index f4c8c76..f3605da 100644
@@ -18,7 +18,7 @@ LIBINTL_TARGET_BINARY:=usr/lib/libintl.so
 endif
 
 $(DL_DIR)/$(GETTEXT_SOURCE):
-	 $(call DOWNLOAD,$(GETTEXT_SITE),$(GETTEXT_SOURCE))
+	 $(call DOWNLOAD,$(GETTEXT_SITE)/$(GETTEXT_SOURCE))
 
 gettext-source: $(DL_DIR)/$(GETTEXT_SOURCE)
 
package/microperl/microperl.mk +1 -1
index b68e825..ae442a0 100644
@@ -18,7 +18,7 @@ MICROPERL_MODS+=File/Basename.pm Errno.pm Config.pm IO/File.pm Symbol.pm \
 	DynaLoader.pm AutoLoader.pm Carp/Heavy.pm
 endif
 $(DL_DIR)/$(MICROPERL_SOURCE):
-	$(call DOWNLOAD,$(MICROPERL_SITE),$(MICROPERL_SOURCE))
+	$(call DOWNLOAD,$(MICROPERL_SITE)/$(MICROPERL_SOURCE))
 
 $(MICROPERL_DIR)/.source: $(DL_DIR)/$(MICROPERL_SOURCE)
 	$(MICROPERL_CAT) $(DL_DIR)/$(MICROPERL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/netkitbase/netkitbase.mk +1 -1
index dde8f9f..83991f2 100644
@@ -12,7 +12,7 @@ NETKITBASE_BINARY:=inetd/inetd
 NETKITBASE_TARGET_BINARY:=usr/sbin/inetd
 
 $(DL_DIR)/$(NETKITBASE_SOURCE):
-	 $(call DOWNLOAD,$(NETKITBASE_SITE),$(NETKITBASE_SOURCE))
+	 $(call DOWNLOAD,$(NETKITBASE_SITE)/$(NETKITBASE_SOURCE))
 
 netkitbase-source: $(DL_DIR)/$(NETKITBASE_SOURCE)
 
package/netkittelnet/netkittelnet.mk +1 -1
index e9f40ca..ff05318 100644
@@ -12,7 +12,7 @@ NETKITTELNET_BINARY:=telnetd/telnetd
 NETKITTELNET_TARGET_BINARY:=usr/sbin/telnetd
 
 $(DL_DIR)/$(NETKITTELNET_SOURCE):
-	 $(call DOWNLOAD,$(NETKITTELNET_SITE),$(NETKITTELNET_SOURCE))
+	 $(call DOWNLOAD,$(NETKITTELNET_SITE)/$(NETKITTELNET_SOURCE))
 
 netkittelnet-source: $(DL_DIR)/$(NETKITTELNET_SOURCE)
 
package/newt/newt.mk +1 -1
index eb944a9..ac450e0 100644
@@ -11,7 +11,7 @@ NEWT_VERSION=0.51.0
 NEWT_CFLAGS=-Os -g -fPIC
 
 $(DL_DIR)/$(NEWT_SOURCE):
-	$(call DOWNLOAD,$(NEWT_SITE),$(NEWT_SOURCE))
+	$(call DOWNLOAD,$(NEWT_SITE)/$(NEWT_SOURCE))
 
 $(NEWT_DIR)/.source: $(DL_DIR)/$(NEWT_SOURCE)
 	$(NEWT_CAT) $(DL_DIR)/$(NEWT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/tinyhttpd/tinyhttpd.mk +1 -1
index 739849f..0f95d06 100644
@@ -12,7 +12,7 @@ TINYHTTPD_BINARY:=httpd
 TINYHTTPD_TARGET_BINARY:=usr/sbin/tinyhttpd
 
 $(DL_DIR)/$(TINYHTTPD_SOURCE):
-	 $(call DOWNLOAD,$(TINYHTTPD_SITE),$(TINYHTTPD_SOURCE))
+	 $(call DOWNLOAD,$(TINYHTTPD_SITE)/$(TINYHTTPD_SOURCE))
 
 tinyhttpd-source: $(DL_DIR)/$(TINYHTTPD_SOURCE)
 
package/ttcp/ttcp.mk +1 -1
index 006b74c..1acf120 100644
@@ -10,7 +10,7 @@ TTCP_SOURCE=ttcp$(TTCP_VERSION).c
 TTCP_DIR=$(BUILD_DIR)/ttcp$(TTCP_VERSION)
 
 $(DL_DIR)/$(TTCP_SOURCE):
-	 $(call DOWNLOAD,$(TTCP_SOURCE_URL),$(TTCP_SOURCE))
+	 $(call DOWNLOAD,$(TTCP_SOURCE_URL)/$(TTCP_SOURCE))
 
 $(TTCP_DIR)/.unpacked: $(DL_DIR)/$(TTCP_SOURCE)
 	-mkdir $(TTCP_DIR)
package/uemacs/uemacs.mk +1 -1
index 8355a7f..62b0911 100644
@@ -12,7 +12,7 @@ UEMACS_BINARY:=em
 UEMACS_TARGET_BINARY:=usr/bin/emacs
 
 $(DL_DIR)/$(UEMACS_SOURCE):
-	 $(call DOWNLOAD,$(UEMACS_SITE),$(UEMACS_SOURCE))
+	 $(call DOWNLOAD,$(UEMACS_SITE)/$(UEMACS_SOURCE))
 
 uemacs-source: $(DL_DIR)/$(UEMACS_SOURCE)
 
package/vpnc/vpnc.mk +1 -1
index 5a8c700..d8d9654 100644
@@ -15,7 +15,7 @@ VPNC_TARGET_BINARY:=$(VPNC_DEST_DIR)/vpnc
 VPNC_TARGET_SCRIPT:=$(TARGET_DIR)/etc/vpnc/default.conf
 
 $(DL_DIR)/$(VPNC_SOURCE):
-	$(call DOWNLOAD,$(VPNC_SITE),$(VPNC_SOURCE))
+	$(call DOWNLOAD,$(VPNC_SITE)/$(VPNC_SOURCE))
 
 $(VPNC_DIR)/.unpacked: $(DL_DIR)/$(VPNC_SOURCE)
 	$(VPNC_CAT) $(DL_DIR)/$(VPNC_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/xfsprogs/xfsprogs.mk +1 -1
index 68db2f7..52fec09 100644
@@ -18,7 +18,7 @@ XFSPROGS_STRIP_LIBDEP:= \
 	repair/xfs_repair quota/xfs_quota
 
 $(DL_DIR)/$(XFSPROGS_SOURCE):
-	 $(call DOWNLOAD,$(XFSPROGS_SITE),$(XFSPROGS_SOURCE))
+	 $(call DOWNLOAD,$(XFSPROGS_SITE)/$(XFSPROGS_SOURCE))
 
 xfsprogs-source: $(DL_DIR)/$(XFSPROGS_SOURCE)
 
toolchain/gcc/gcc-uclibc-4.x.mk +1 -1
index 5eb7505..d9547fb 100644
@@ -172,7 +172,7 @@ endif
 
 $(DL_DIR)/$(GCC_SOURCE):
 	mkdir -p $(DL_DIR)
-	$(call DOWNLOAD,$(GCC_SITE),$(GCC_SOURCE))
+	$(call DOWNLOAD,$(GCC_SITE)/$(GCC_SOURCE))
 
 gcc-unpacked: $(GCC_DIR)/.patched
 $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
toolchain/gdb/gdb.mk +1 -1
index 56faf49..b5c085b 100644
@@ -24,7 +24,7 @@ endif
 GDB_DIR:=$(TOOLCHAIN_DIR)/gdb-$(GDB_VERSION)
 
 $(DL_DIR)/$(GDB_SOURCE):
-	$(call DOWNLOAD,$(GDB_SITE),$(GDB_SOURCE))
+	$(call DOWNLOAD,$(GDB_SITE)/$(GDB_SOURCE))
 
 gdb-unpacked: $(GDB_DIR)/.unpacked
 $(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
toolchain/kernel-headers/kernel-headers.mk +1 -1
index 72c6007..c464c37 100644
@@ -81,7 +81,7 @@ $(DL_DIR)/$(LINUX_HEADERS_SOURCE):
 ifeq ($(BR2_KERNEL_HEADERS_SNAP),y)
 	$(error No local $@ found, cannot continue. Are you sure you wanted to enable BR2_KERNEL_HEADERS_SNAP?)
 endif
-	$(call DOWNLOAD,$(LINUX_HEADERS_SITE),$(LINUX_HEADERS_SOURCE))
+	$(call DOWNLOAD,$(LINUX_HEADERS_SITE)/$(LINUX_HEADERS_SOURCE))
 
 kernel-headers: $(LINUX_HEADERS_DIR)/.configured
 
toolchain/toolchain-external/ext-tool.mk +3 -3
index 2ac4973..8f75fcf 100644
@@ -225,10 +225,10 @@ endif
 # components than usual.
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2010RC1),y)
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_1),$(TOOLCHAIN_EXTERNAL_SOURCE_1))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_1)/$(TOOLCHAIN_EXTERNAL_SOURCE_1))
 
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_2),$(TOOLCHAIN_EXTERNAL_SOURCE_2))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_2)/$(TOOLCHAIN_EXTERNAL_SOURCE_2))
 
 $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2)
 	mkdir -p $(@D)
@@ -251,7 +251,7 @@ endif
 else
 # Download and extraction of a toolchain
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE),$(TOOLCHAIN_EXTERNAL_SOURCE))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE)/$(TOOLCHAIN_EXTERNAL_SOURCE))
 
 $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE)
 	mkdir -p $(@D)
toolchain/uClibc/uclibc.mk +1 -1
index ee474bb..32cbe46 100644
@@ -67,7 +67,7 @@ UCLIBC_ARM_TYPE:=CONFIG_$(call qstrip,$(BR2_ARM_TYPE))
 UCLIBC_SPARC_TYPE:=CONFIG_SPARC_$(call qstrip,$(BR2_SPARC_TYPE))
 
 $(DL_DIR)/$(UCLIBC_SOURCE):
-	$(call DOWNLOAD,$(UCLIBC_SITE),$(UCLIBC_SOURCE))
+	$(call DOWNLOAD,$(UCLIBC_SITE)/$(UCLIBC_SOURCE))
 
 uclibc-unpacked: $(UCLIBC_DIR)/.unpacked
 $(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
Signature · 1 line
1.7.9
#11 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

Sorry, there are still a few things I missed before...

On Friday 17 February 2012 12:10:01 Alvaro G. M wrote:

[snip]

Quoted 5 lines
package/Makefile.package.in +0 -0
index 33461b4..a96031e 100644

package/Makefile.package.in endef · line 210

Quoted 10 lines
package/Makefile.package.in +2 -2
@@ -203,11 +203,11 @@ endef
 # to prepend the path with a slash: scp://[user@]host:/absolutepath
 define DOWNLOAD_SCP
 	test -e $(DL_DIR)/$(2) || \
-	$(SCP) $(call stripurischeme,$(call qstrip,$(1)))/$(2) $(DL_DIR)
+	$(SCP) '$(call stripurischeme,$(call qstrip,$(1)))' $(DL_DIR)/$(2)
 endef
 
 define SOURCE_CHECK_SCP
-	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1)/$(2),:) > /dev/null
+	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1),:) > /dev/null

There should probably be quotes here as well. Although, when you use
scp, it's not very likely that the directory name contains evil characters.

Quoted 4 lines
package/Makefile.package.in +0 -0
 endef
 
 define SHOW_EXTERNAL_DEPS_SCP

package/Makefile.package.in endef · line 245

Quoted 10 lines
package/Makefile.package.in +2 -2
@@ -238,11 +238,11 @@ endef
 
 define DOWNLOAD_WGET
 	test -e $(DL_DIR)/$(2) || \
-	$(WGET) -P $(DL_DIR) $(call qstrip,$(1))/$(2)
+	$(WGET) -O $(DL_DIR)/$(2) '$(call qstrip,$(1))'
 endef
 
 define SOURCE_CHECK_WGET
-  $(WGET) --spider $(call qstrip,$(1))/$(2)
+  $(WGET) --spider $(call qstrip,$(1))

Here quotes are definitely needed or we get in trouble with URLs
containing & or ;.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#12 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

That's right. I can solve that in a moment.

2012/2/18 Arnout Vandecappelle <[email protected]>

Quoted 58 lines

Sorry, there are still a few things I missed before...

On Friday 17 February 2012 12:10:01 Alvaro G. M wrote:

[snip]

Quoted 5 lines
package/Makefile.package.in +0 -0
index 33461b4..a96031e 100644

package/Makefile.package.in endef · line 210

Quoted 9 lines
package/Makefile.package.in +1 -2
@@ -203,11 +203,11 @@ endef
 # to prepend the path with a slash: scp://[user@]host:/absolutepath
 define DOWNLOAD_SCP
      test -e $(DL_DIR)/$(2) || \
-     $(SCP) $(call stripurischeme,$(call qstrip,$(1)))/$(2) $(DL_DIR)
+     $(SCP) '$(call stripurischeme,$(call qstrip,$(1)))' $(DL_DIR)/$(2)
 endef
 
 define SOURCE_CHECK_SCP
-     $(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1)/$(2),:) >

/dev/null

package/Makefile.package.in endef · line 210

Quoted 1 line
package/Makefile.package.in +1 -0
+     $(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1),:) >

/dev/null

There should probably be quotes here as well. Although, when you use
scp, it's not very likely that the directory name contains evil characters.

Quoted 4 lines
package/Makefile.package.in +0 -0
 endef
 
 define SHOW_EXTERNAL_DEPS_SCP

package/Makefile.package.in endef · line 245

Quoted 10 lines
package/Makefile.package.in +2 -2
@@ -238,11 +238,11 @@ endef
 
 define DOWNLOAD_WGET
      test -e $(DL_DIR)/$(2) || \
-     $(WGET) -P $(DL_DIR) $(call qstrip,$(1))/$(2)
+     $(WGET) -O $(DL_DIR)/$(2) '$(call qstrip,$(1))'
 endef
 
 define SOURCE_CHECK_WGET
-  $(WGET) --spider $(call qstrip,$(1))/$(2)
+  $(WGET) --spider $(call qstrip,$(1))

Here quotes are definitely needed or we get in trouble with URLs
containing & or ;.

Regards,
Arnout

--

Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR
Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
Signature · 4 lines
?lvaro G?mez Machado
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120218/91ed5f34/attachment.html>
#13 lore raw

PATCH 1/1 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME

In reply to Arnout Vandecappelle

From: "Alvaro G. M" <[email protected]>

This modifies the definition of DOWNLOAD to receive two arguments:
the first one is the full URL of the file to download, whereas the second (and optional) is the name the file will have once downloaded.

Same thing with the SOURCE_CHECK_WGET and SCP functions.

All calls to these functions have been changed to the shortest form of the new API.

---
 docs/manual/adding-packages-handwritten.txt |    2 +-
 linux/linux.mk                              |    2 +-
 package/Makefile.package.in                 |   18 +++++++++++-------
 package/cups/cups.mk                        |    2 +-
 package/fis/fis.mk                          |    2 +-
 package/games/doom-wad/doom-wads.mk         |    2 +-
 package/gettext/gettext.mk                  |    2 +-
 package/microperl/microperl.mk              |    2 +-
 package/netkitbase/netkitbase.mk            |    2 +-
 package/netkittelnet/netkittelnet.mk        |    2 +-
 package/newt/newt.mk                        |    2 +-
 package/tinyhttpd/tinyhttpd.mk              |    2 +-
 package/ttcp/ttcp.mk                        |    2 +-
 package/uemacs/uemacs.mk                    |    2 +-
 package/vpnc/vpnc.mk                        |    2 +-
 package/xfsprogs/xfsprogs.mk                |    2 +-
 toolchain/gcc/gcc-uclibc-4.x.mk             |    2 +-
 toolchain/gdb/gdb.mk                        |    2 +-
 toolchain/kernel-headers/kernel-headers.mk  |    2 +-
 toolchain/toolchain-external/ext-tool.mk    |    6 +++---
 toolchain/uClibc/uclibc.mk                  |    2 +-
 21 files changed, 33 insertions(+), 29 deletions(-)
docs/manual/adding-packages-handwritten.txt +1 -1
index a9d247c..583f303 100644
@@ -22,7 +22,7 @@ existing manual makefiles and to help understand how they work.*
 11: LIBFOO_TARGET_BINARY:=usr/bin/foo
 12:
 13: $(DL_DIR)/$(LIBFOO_SOURCE):
-14: 	$(call DOWNLOAD,$(LIBFOO_SITE),$(LIBFOO_SOURCE))
+14: 	$(call DOWNLOAD,$(LIBFOO_SITE)/$(LIBFOO_SOURCE))
 15:
 16: $(LIBFOO_DIR)/.source: $(DL_DIR)/$(LIBFOO_SOURCE)
 17: 	$(ZCAT) $(DL_DIR)/$(LIBFOO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
linux/linux.mk +1 -1
index ae236d4..58cbe8e 100644
@@ -98,7 +98,7 @@ define LINUX_DOWNLOAD_PATCHES
 	$(if $(LINUX_PATCHES),
 		@$(call MESSAGE,"Download additional patches"))
 	$(foreach patch,$(filter ftp://% http://%,$(LINUX_PATCHES)),\
-		$(call DOWNLOAD,$(dir $(patch)),$(notdir $(patch)))$(sep))
+		$(call DOWNLOAD,$(patch))$(sep))
 endef
 
 LINUX_POST_DOWNLOAD_HOOKS += LINUX_DOWNLOAD_PATCHES
package/Makefile.package.in +11 -7
index 33461b4..dd05224 100644
@@ -203,11 +203,11 @@ endef
 # to prepend the path with a slash: scp://[user@]host:/absolutepath
 define DOWNLOAD_SCP
 	test -e $(DL_DIR)/$(2) || \
-	$(SCP) $(call stripurischeme,$(call qstrip,$(1)))/$(2) $(DL_DIR)
+	$(SCP) '$(call stripurischeme,$(call qstrip,$(1)))' $(DL_DIR)/$(2)
 endef
 
 define SOURCE_CHECK_SCP
-	$(SSH) $(call domain,$(1),:) ls $(call notdomain,$(1)/$(2),:) > /dev/null
+	$(SSH) $(call domain,$(1),:) ls '$(call notdomain,$(1),:)' > /dev/null
 endef
 
 define SHOW_EXTERNAL_DEPS_SCP
@@ -238,11 +238,11 @@ endef
 
 define DOWNLOAD_WGET
 	test -e $(DL_DIR)/$(2) || \
-	$(WGET) -P $(DL_DIR) $(call qstrip,$(1))/$(2)
+	$(WGET) -O $(DL_DIR)/$(2) '$(call qstrip,$(1))'
 endef
 
 define SOURCE_CHECK_WGET
-  $(WGET) --spider $(call qstrip,$(1))/$(2)
+  $(WGET) --spider '$(call qstrip,$(1))'
 endef
 
 define SHOW_EXTERNAL_DEPS_WGET
@@ -276,6 +276,10 @@ endef
 ################################################################################
 
 define DOWNLOAD
+	$(call DOWNLOAD_INNER,$(1),$(if $(2),$(2),$(notdir $(1))))
+endef
+
+define DOWNLOAD_INNER
 	$(Q)if test -n "$(call qstrip,$(BR2_PRIMARY_SITE))" ; then \
 		case "$(call geturischeme,$(BR2_PRIMARY_SITE))" in \
 			scp) $(call $(DL_MODE)_SCP,$(BR2_PRIMARY_SITE),$(2)) && exit ;; \
@@ -294,7 +298,7 @@ define DOWNLOAD
 		esac ; \
 	fi ; \
 	if test -n "$(call qstrip,$(BR2_BACKUP_SITE))" ; then \
-		$(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE),$(2)) && exit ; \
+		$(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE)/$(2),$(2)) && exit ; \
 	fi ; \
 	exit 1
 endef
@@ -318,8 +322,8 @@ ifeq ($(DL_MODE),DOWNLOAD)
 		(test -z $($(PKG)_PATCH) || test -e $(DL_DIR)$($(PKG)_PATCH))) || \
 		$(call MESSAGE,"Downloading")
 endif
-	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_SOURCE)))
-	$(if $($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_PATCH)))
+	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
+	$(if $($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_PATCH)))
 	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
 ifeq ($(DL_MODE),DOWNLOAD)
 	$(Q)mkdir -p $(@D)
package/cups/cups.mk +1 -1
index 4e8db71..9efd6e9 100644
@@ -65,7 +65,7 @@ else
 endif
 
 $(DL_DIR)/$(CUPS_SOURCE):
-	 $(call DOWNLOAD,$(CUPS_SITE),$(CUPS_SOURCE))
+	 $(call DOWNLOAD,$(CUPS_SITE)/$(CUPS_SOURCE))
 
 $(CUPS_DIR)/.unpacked: $(DL_DIR)/$(CUPS_SOURCE)
 	$(CUPS_CAT) $(DL_DIR)/$(CUPS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/fis/fis.mk +1 -1
index 2942449..0975f3f 100644
@@ -11,7 +11,7 @@ FIS_BINARY:=fis
 FIS_TARGET_BINARY:=sbin/fis
 
 $(DL_DIR)/$(FIS_SOURCE):
-	 $(call DOWNLOAD,$(FIS_SITE),$(FIS_SOURCE))
+	 $(call DOWNLOAD,$(FIS_SITE)/$(FIS_SOURCE))
 
 fis-source: $(DL_DIR)/$(FIS_SOURCE)
 
package/games/doom-wad/doom-wads.mk +1 -1
index bae2420..c0bf4fb 100644
@@ -10,7 +10,7 @@ DOOM_WAD_SITE = ftp://ftp.idsoftware.com/idstuff/doom/
 DOOM_WAD_DIR=$(BUILD_DIR)/doom-wad-$(DOOM_WAD_VERSION)
 
 $(DL_DIR)/$(DOOM_WAD_SOURCE):
-	 $(call DOWNLOAD,$(DOOM_WAD_SITE),$(DOOM_WAD_SOURCE))
+	 $(call DOWNLOAD,$(DOOM_WAD_SITE)/$(DOOM_WAD_SOURCE))
 
 doom-wad-source: $(DL_DIR)/$(DOOM_WAD_SOURCE)
 
package/gettext/gettext.mk +1 -1
index f4c8c76..f3605da 100644
@@ -18,7 +18,7 @@ LIBINTL_TARGET_BINARY:=usr/lib/libintl.so
 endif
 
 $(DL_DIR)/$(GETTEXT_SOURCE):
-	 $(call DOWNLOAD,$(GETTEXT_SITE),$(GETTEXT_SOURCE))
+	 $(call DOWNLOAD,$(GETTEXT_SITE)/$(GETTEXT_SOURCE))
 
 gettext-source: $(DL_DIR)/$(GETTEXT_SOURCE)
 
package/microperl/microperl.mk +1 -1
index b68e825..ae442a0 100644
@@ -18,7 +18,7 @@ MICROPERL_MODS+=File/Basename.pm Errno.pm Config.pm IO/File.pm Symbol.pm \
 	DynaLoader.pm AutoLoader.pm Carp/Heavy.pm
 endif
 $(DL_DIR)/$(MICROPERL_SOURCE):
-	$(call DOWNLOAD,$(MICROPERL_SITE),$(MICROPERL_SOURCE))
+	$(call DOWNLOAD,$(MICROPERL_SITE)/$(MICROPERL_SOURCE))
 
 $(MICROPERL_DIR)/.source: $(DL_DIR)/$(MICROPERL_SOURCE)
 	$(MICROPERL_CAT) $(DL_DIR)/$(MICROPERL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/netkitbase/netkitbase.mk +1 -1
index dde8f9f..83991f2 100644
@@ -12,7 +12,7 @@ NETKITBASE_BINARY:=inetd/inetd
 NETKITBASE_TARGET_BINARY:=usr/sbin/inetd
 
 $(DL_DIR)/$(NETKITBASE_SOURCE):
-	 $(call DOWNLOAD,$(NETKITBASE_SITE),$(NETKITBASE_SOURCE))
+	 $(call DOWNLOAD,$(NETKITBASE_SITE)/$(NETKITBASE_SOURCE))
 
 netkitbase-source: $(DL_DIR)/$(NETKITBASE_SOURCE)
 
package/netkittelnet/netkittelnet.mk +1 -1
index e9f40ca..ff05318 100644
@@ -12,7 +12,7 @@ NETKITTELNET_BINARY:=telnetd/telnetd
 NETKITTELNET_TARGET_BINARY:=usr/sbin/telnetd
 
 $(DL_DIR)/$(NETKITTELNET_SOURCE):
-	 $(call DOWNLOAD,$(NETKITTELNET_SITE),$(NETKITTELNET_SOURCE))
+	 $(call DOWNLOAD,$(NETKITTELNET_SITE)/$(NETKITTELNET_SOURCE))
 
 netkittelnet-source: $(DL_DIR)/$(NETKITTELNET_SOURCE)
 
package/newt/newt.mk +1 -1
index eb944a9..ac450e0 100644
@@ -11,7 +11,7 @@ NEWT_VERSION=0.51.0
 NEWT_CFLAGS=-Os -g -fPIC
 
 $(DL_DIR)/$(NEWT_SOURCE):
-	$(call DOWNLOAD,$(NEWT_SITE),$(NEWT_SOURCE))
+	$(call DOWNLOAD,$(NEWT_SITE)/$(NEWT_SOURCE))
 
 $(NEWT_DIR)/.source: $(DL_DIR)/$(NEWT_SOURCE)
 	$(NEWT_CAT) $(DL_DIR)/$(NEWT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/tinyhttpd/tinyhttpd.mk +1 -1
index 739849f..0f95d06 100644
@@ -12,7 +12,7 @@ TINYHTTPD_BINARY:=httpd
 TINYHTTPD_TARGET_BINARY:=usr/sbin/tinyhttpd
 
 $(DL_DIR)/$(TINYHTTPD_SOURCE):
-	 $(call DOWNLOAD,$(TINYHTTPD_SITE),$(TINYHTTPD_SOURCE))
+	 $(call DOWNLOAD,$(TINYHTTPD_SITE)/$(TINYHTTPD_SOURCE))
 
 tinyhttpd-source: $(DL_DIR)/$(TINYHTTPD_SOURCE)
 
package/ttcp/ttcp.mk +1 -1
index 006b74c..1acf120 100644
@@ -10,7 +10,7 @@ TTCP_SOURCE=ttcp$(TTCP_VERSION).c
 TTCP_DIR=$(BUILD_DIR)/ttcp$(TTCP_VERSION)
 
 $(DL_DIR)/$(TTCP_SOURCE):
-	 $(call DOWNLOAD,$(TTCP_SOURCE_URL),$(TTCP_SOURCE))
+	 $(call DOWNLOAD,$(TTCP_SOURCE_URL)/$(TTCP_SOURCE))
 
 $(TTCP_DIR)/.unpacked: $(DL_DIR)/$(TTCP_SOURCE)
 	-mkdir $(TTCP_DIR)
package/uemacs/uemacs.mk +1 -1
index 8355a7f..62b0911 100644
@@ -12,7 +12,7 @@ UEMACS_BINARY:=em
 UEMACS_TARGET_BINARY:=usr/bin/emacs
 
 $(DL_DIR)/$(UEMACS_SOURCE):
-	 $(call DOWNLOAD,$(UEMACS_SITE),$(UEMACS_SOURCE))
+	 $(call DOWNLOAD,$(UEMACS_SITE)/$(UEMACS_SOURCE))
 
 uemacs-source: $(DL_DIR)/$(UEMACS_SOURCE)
 
package/vpnc/vpnc.mk +1 -1
index 5a8c700..d8d9654 100644
@@ -15,7 +15,7 @@ VPNC_TARGET_BINARY:=$(VPNC_DEST_DIR)/vpnc
 VPNC_TARGET_SCRIPT:=$(TARGET_DIR)/etc/vpnc/default.conf
 
 $(DL_DIR)/$(VPNC_SOURCE):
-	$(call DOWNLOAD,$(VPNC_SITE),$(VPNC_SOURCE))
+	$(call DOWNLOAD,$(VPNC_SITE)/$(VPNC_SOURCE))
 
 $(VPNC_DIR)/.unpacked: $(DL_DIR)/$(VPNC_SOURCE)
 	$(VPNC_CAT) $(DL_DIR)/$(VPNC_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
package/xfsprogs/xfsprogs.mk +1 -1
index 68db2f7..52fec09 100644
@@ -18,7 +18,7 @@ XFSPROGS_STRIP_LIBDEP:= \
 	repair/xfs_repair quota/xfs_quota
 
 $(DL_DIR)/$(XFSPROGS_SOURCE):
-	 $(call DOWNLOAD,$(XFSPROGS_SITE),$(XFSPROGS_SOURCE))
+	 $(call DOWNLOAD,$(XFSPROGS_SITE)/$(XFSPROGS_SOURCE))
 
 xfsprogs-source: $(DL_DIR)/$(XFSPROGS_SOURCE)
 
toolchain/gcc/gcc-uclibc-4.x.mk +1 -1
index 5eb7505..d9547fb 100644
@@ -172,7 +172,7 @@ endif
 
 $(DL_DIR)/$(GCC_SOURCE):
 	mkdir -p $(DL_DIR)
-	$(call DOWNLOAD,$(GCC_SITE),$(GCC_SOURCE))
+	$(call DOWNLOAD,$(GCC_SITE)/$(GCC_SOURCE))
 
 gcc-unpacked: $(GCC_DIR)/.patched
 $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
toolchain/gdb/gdb.mk +1 -1
index 56faf49..b5c085b 100644
@@ -24,7 +24,7 @@ endif
 GDB_DIR:=$(TOOLCHAIN_DIR)/gdb-$(GDB_VERSION)
 
 $(DL_DIR)/$(GDB_SOURCE):
-	$(call DOWNLOAD,$(GDB_SITE),$(GDB_SOURCE))
+	$(call DOWNLOAD,$(GDB_SITE)/$(GDB_SOURCE))
 
 gdb-unpacked: $(GDB_DIR)/.unpacked
 $(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
toolchain/kernel-headers/kernel-headers.mk +1 -1
index 72c6007..c464c37 100644
@@ -81,7 +81,7 @@ $(DL_DIR)/$(LINUX_HEADERS_SOURCE):
 ifeq ($(BR2_KERNEL_HEADERS_SNAP),y)
 	$(error No local $@ found, cannot continue. Are you sure you wanted to enable BR2_KERNEL_HEADERS_SNAP?)
 endif
-	$(call DOWNLOAD,$(LINUX_HEADERS_SITE),$(LINUX_HEADERS_SOURCE))
+	$(call DOWNLOAD,$(LINUX_HEADERS_SITE)/$(LINUX_HEADERS_SOURCE))
 
 kernel-headers: $(LINUX_HEADERS_DIR)/.configured
 
toolchain/toolchain-external/ext-tool.mk +3 -3
index 2ac4973..8f75fcf 100644
@@ -225,10 +225,10 @@ endif
 # components than usual.
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2010RC1),y)
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_1),$(TOOLCHAIN_EXTERNAL_SOURCE_1))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_1)/$(TOOLCHAIN_EXTERNAL_SOURCE_1))
 
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_2),$(TOOLCHAIN_EXTERNAL_SOURCE_2))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE_2)/$(TOOLCHAIN_EXTERNAL_SOURCE_2))
 
 $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_1) $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE_2)
 	mkdir -p $(@D)
@@ -251,7 +251,7 @@ endif
 else
 # Download and extraction of a toolchain
 $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE):
-	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE),$(TOOLCHAIN_EXTERNAL_SOURCE))
+	$(call DOWNLOAD,$(TOOLCHAIN_EXTERNAL_SITE)/$(TOOLCHAIN_EXTERNAL_SOURCE))
 
 $(TOOLCHAIN_EXTERNAL_DIR)/.extracted: $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE)
 	mkdir -p $(@D)
toolchain/uClibc/uclibc.mk +1 -1
index ee474bb..32cbe46 100644
@@ -67,7 +67,7 @@ UCLIBC_ARM_TYPE:=CONFIG_$(call qstrip,$(BR2_ARM_TYPE))
 UCLIBC_SPARC_TYPE:=CONFIG_SPARC_$(call qstrip,$(BR2_SPARC_TYPE))
 
 $(DL_DIR)/$(UCLIBC_SOURCE):
-	$(call DOWNLOAD,$(UCLIBC_SITE),$(UCLIBC_SOURCE))
+	$(call DOWNLOAD,$(UCLIBC_SITE)/$(UCLIBC_SOURCE))
 
 uclibc-unpacked: $(UCLIBC_DIR)/.unpacked
 $(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
Signature · 1 line
1.7.9