* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME
@ 2012-02-15 20:31 Alvaro Gamez
2012-02-15 20:36 ` Alvaro Gamez
2012-02-15 21:05 ` Arnout Vandecappelle
0 siblings, 2 replies; 14+ messages in thread
From: Alvaro Gamez @ 2012-02-15 20:31 UTC (permalink / raw)
To: buildroot
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.
Signed-off-by: Alvaro Gamez Machado <alvaro.gamez@hazent.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012/2/14 Arnout Vandecappelle <arnout@mind.be>
> **
>
> 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
>
--
?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>
^ permalink raw reply [flat|nested] 14+ messages in thread* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-15 20:31 [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME Alvaro Gamez @ 2012-02-15 20:36 ` Alvaro Gamez 2012-02-15 21:05 ` Arnout Vandecappelle 1 sibling, 0 replies; 14+ messages in thread From: Alvaro Gamez @ 2012-02-15 20:36 UTC (permalink / raw) To: buildroot 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 <alvaro.gamez@hazent.com> > 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. > > Signed-off-by: Alvaro Gamez Machado <alvaro.gamez@hazent.com> > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> > Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> > > 2012/2/14 Arnout Vandecappelle <arnout@mind.be> > >> ** >> >> 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 >> > > > > -- > ?lvaro G?mez Machado > > -- ?lvaro G?mez Machado -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120215/3ea3e3f2/attachment.html> ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-15 20:31 [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME Alvaro Gamez 2012-02-15 20:36 ` Alvaro Gamez @ 2012-02-15 21:05 ` Arnout Vandecappelle 2012-02-15 23:40 ` Arnout Vandecappelle 1 sibling, 1 reply; 14+ messages in thread From: Arnout Vandecappelle @ 2012-02-15 21:05 UTC (permalink / raw) To: buildroot From: "Alvaro G. M" <alvaro.gamez@hazent.com> 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)) Signed-off-by: Alvaro Gamez Machado <alvaro.gamez@hazent.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> --- [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(-) diff --git a/docs/buildroot.html b/docs/buildroot.html index ddfb20a..e0f6ad8 100644 --- a/docs/buildroot.html +++ b/docs/buildroot.html @@ -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) - diff --git a/docs/manual/adding-packages-handwritten.txt b/docs/manual/adding-packages-handwritten.txt index a9d247c..938885a 100644 --- a/docs/manual/adding-packages-handwritten.txt +++ b/docs/manual/adding-packages-handwritten.txt @@ -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) - diff --git a/linux/linux.mk b/linux/linux.mk index ae236d4..d1a05a1 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -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 diff --git a/package/Makefile.package.in b/package/Makefile.package.in index 33461b4..3714de0 100644 --- a/package/Makefile.package.in +++ b/package/Makefile.package.in @@ -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 diff --git a/package/cups/cups.mk b/package/cups/cups.mk index 4e8db71..ed2e72c 100644 --- a/package/cups/cups.mk +++ b/package/cups/cups.mk @@ -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) - diff --git a/package/fis/fis.mk b/package/fis/fis.mk index 2942449..c400dea 100644 --- a/package/fis/fis.mk +++ b/package/fis/fis.mk @@ -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) diff --git a/package/games/doom-wad/doom-wads.mk b/package/games/doom-wad/doom-wads.mk index bae2420..2e41ef4 100644 --- a/package/games/doom-wad/doom-wads.mk +++ b/package/games/doom-wad/doom-wads.mk @@ -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) diff --git a/package/gettext/gettext.mk b/package/gettext/gettext.mk index f4c8c76..a8a6458 100644 --- a/package/gettext/gettext.mk +++ b/package/gettext/gettext.mk @@ -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) diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk index b68e825..39cee3d 100644 --- a/package/microperl/microperl.mk +++ b/package/microperl/microperl.mk @@ -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) - diff --git a/package/netkitbase/netkitbase.mk b/package/netkitbase/netkitbase.mk index dde8f9f..632960e 100644 --- a/package/netkitbase/netkitbase.mk +++ b/package/netkitbase/netkitbase.mk @@ -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) diff --git a/package/netkittelnet/netkittelnet.mk b/package/netkittelnet/netkittelnet.mk index e9f40ca..961ae03 100644 --- a/package/netkittelnet/netkittelnet.mk +++ b/package/netkittelnet/netkittelnet.mk @@ -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) diff --git a/package/newt/newt.mk b/package/newt/newt.mk index eb944a9..a9ed074 100644 --- a/package/newt/newt.mk +++ b/package/newt/newt.mk @@ -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) - diff --git a/package/tinyhttpd/tinyhttpd.mk b/package/tinyhttpd/tinyhttpd.mk index 739849f..8f59661 100644 --- a/package/tinyhttpd/tinyhttpd.mk +++ b/package/tinyhttpd/tinyhttpd.mk @@ -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) diff --git a/package/ttcp/ttcp.mk b/package/ttcp/ttcp.mk index 006b74c..f9035e4 100644 --- a/package/ttcp/ttcp.mk +++ b/package/ttcp/ttcp.mk @@ -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) diff --git a/package/uemacs/uemacs.mk b/package/uemacs/uemacs.mk index 8355a7f..63b97b9 100644 --- a/package/uemacs/uemacs.mk +++ b/package/uemacs/uemacs.mk @@ -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) diff --git a/package/vpnc/vpnc.mk b/package/vpnc/vpnc.mk index 5a8c700..00b1375 100644 --- a/package/vpnc/vpnc.mk +++ b/package/vpnc/vpnc.mk @@ -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) - diff --git a/package/xfsprogs/xfsprogs.mk b/package/xfsprogs/xfsprogs.mk index 68db2f7..7c3fb01 100644 --- a/package/xfsprogs/xfsprogs.mk +++ b/package/xfsprogs/xfsprogs.mk @@ -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) diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk index 5eb7505..4938fd2 100644 --- a/toolchain/gcc/gcc-uclibc-4.x.mk +++ b/toolchain/gcc/gcc-uclibc-4.x.mk @@ -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) diff --git a/toolchain/gdb/gdb.mk b/toolchain/gdb/gdb.mk index 56faf49..2278f2e 100644 --- a/toolchain/gdb/gdb.mk +++ b/toolchain/gdb/gdb.mk @@ -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) diff --git a/toolchain/kernel-headers/kernel-headers.mk b/toolchain/kernel-headers/kernel-headers.mk index 72c6007..7bc7627 100644 --- a/toolchain/kernel-headers/kernel-headers.mk +++ b/toolchain/kernel-headers/kernel-headers.mk @@ -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 diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk index 2ac4973..26f3846 100644 --- a/toolchain/toolchain-external/ext-tool.mk +++ b/toolchain/toolchain-external/ext-tool.mk @@ -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) diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk index ee474bb..a8f3a96 100644 --- a/toolchain/uClibc/uclibc.mk +++ b/toolchain/uClibc/uclibc.mk @@ -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) -- 1.7.8.3 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-15 21:05 ` Arnout Vandecappelle @ 2012-02-15 23:40 ` Arnout Vandecappelle 2012-02-16 8:31 ` Alvaro Gamez 2012-02-16 18:15 ` Alvaro G. M 0 siblings, 2 replies; 14+ messages in thread From: Arnout Vandecappelle @ 2012-02-15 23:40 UTC (permalink / raw) To: buildroot On Wednesday 15 February 2012 22:05:38 Arnout Vandecappelle (Essensium/Mind) wrote: > From: "Alvaro G. M" <alvaro.gamez@hazent.com> > > 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. > Same thing with the, to my knowledge, unused SOURCE_CHECK_WGET and SCP functions. It is used for 'make source-check'. > 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 > 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] > diff --git a/docs/buildroot.html b/docs/buildroot.html > index ddfb20a..e0f6ad8 100644 > --- a/docs/buildroot.html > +++ b/docs/buildroot.html The manually maintained buildroot.html is deprecated and should be removed Real Soon Now (Peter?). > --- a/docs/manual/adding-packages-handwritten.txt > +++ b/docs/manual/adding-packages-handwritten.txt > @@ -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. > 15: > 16: $(LIBFOO_DIR)/.source: $(DL_DIR)/$(LIBFOO_SOURCE) > 17: $(ZCAT) $(DL_DIR)/$(LIBFOO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - > diff --git a/linux/linux.mk b/linux/linux.mk > index ae236d4..d1a05a1 100644 > --- a/linux/linux.mk > +++ b/linux/linux.mk > @@ -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! > endef > > LINUX_POST_DOWNLOAD_HOOKS += LINUX_DOWNLOAD_PATCHES > diff --git a/package/Makefile.package.in b/package/Makefile.package.in > index 33461b4..3714de0 100644 > --- a/package/Makefile.package.in > +++ b/package/Makefile.package.in > @@ -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. > 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 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. > endef > > define SOURCE_CHECK_WGET > - $(WGET) --spider $(call qstrip,$(1))/$(2) > + $(WGET) --spider $(call qstrip,$(1)) > endef > > define SHOW_EXTERNAL_DEPS_WGET > diff --git a/package/cups/cups.mk b/package/cups/cups.mk > index 4e8db71..ed2e72c 100644 > --- a/package/cups/cups.mk > +++ b/package/cups/cups.mk > @@ -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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-15 23:40 ` Arnout Vandecappelle @ 2012-02-16 8:31 ` Alvaro Gamez 2012-02-16 9:07 ` Arnout Vandecappelle 2012-02-16 18:15 ` Alvaro G. M 1 sibling, 1 reply; 14+ messages in thread From: Alvaro Gamez @ 2012-02-16 8:31 UTC (permalink / raw) To: buildroot 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 <arnout@mind.be> > On Wednesday 15 February 2012 22:05:38 Arnout Vandecappelle > (Essensium/Mind) wrote: > > From: "Alvaro G. M" <alvaro.gamez@hazent.com> > > > > 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. > > > > Same thing with the, to my knowledge, unused SOURCE_CHECK_WGET and SCP > functions. > > It is used for 'make source-check'. > > > > 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 > > > > 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] > > diff --git a/docs/buildroot.html b/docs/buildroot.html > > index ddfb20a..e0f6ad8 100644 > > --- a/docs/buildroot.html > > +++ b/docs/buildroot.html > The manually maintained buildroot.html is deprecated and should be > removed Real Soon Now (Peter?). > > > --- a/docs/manual/adding-packages-handwritten.txt > > +++ b/docs/manual/adding-packages-handwritten.txt > > @@ -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. > > > 15: > > 16: $(LIBFOO_DIR)/.source: $(DL_DIR)/$(LIBFOO_SOURCE) > > 17: $(ZCAT) $(DL_DIR)/$(LIBFOO_SOURCE) | tar -C $(BUILD_DIR) > $(TAR_OPTIONS) - > > diff --git a/linux/linux.mk b/linux/linux.mk > > index ae236d4..d1a05a1 100644 > > --- a/linux/linux.mk > > +++ b/linux/linux.mk > > @@ -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! > > > endef > > > > LINUX_POST_DOWNLOAD_HOOKS += LINUX_DOWNLOAD_PATCHES > > diff --git a/package/Makefile.package.in b/package/Makefile.package.in > > index 33461b4..3714de0 100644 > > --- a/package/Makefile.package.in > > +++ b/package/Makefile.package.in > > @@ -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. > > > 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 > > 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. > > > endef > > > > define SOURCE_CHECK_WGET > > - $(WGET) --spider $(call qstrip,$(1))/$(2) > > + $(WGET) --spider $(call qstrip,$(1)) > > endef > > > > define SHOW_EXTERNAL_DEPS_WGET > > diff --git a/package/cups/cups.mk b/package/cups/cups.mk > > index 4e8db71..ed2e72c 100644 > > --- a/package/cups/cups.mk > > +++ b/package/cups/cups.mk > > @@ -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 > -- ?lvaro G?mez Machado -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120216/f92eb632/attachment.html> ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-16 8:31 ` Alvaro Gamez @ 2012-02-16 9:07 ` Arnout Vandecappelle 0 siblings, 0 replies; 14+ messages in thread From: Arnout Vandecappelle @ 2012-02-16 9:07 UTC (permalink / raw) To: buildroot 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 -- 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-15 23:40 ` Arnout Vandecappelle 2012-02-16 8:31 ` Alvaro Gamez @ 2012-02-16 18:15 ` Alvaro G. M 2012-02-16 22:38 ` Arnout Vandecappelle 1 sibling, 1 reply; 14+ messages in thread From: Alvaro G. M @ 2012-02-16 18:15 UTC (permalink / raw) To: buildroot From: "Alvaro G. M." <alvaro.gamez@hazent.com> 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. Signed-off-by: Alvaro G. M. <alvaro.gamez@hazent.com> --- 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(-) diff --git a/docs/manual/adding-packages-handwritten.txt b/docs/manual/adding-packages-handwritten.txt index a9d247c..583f303 100644 --- a/docs/manual/adding-packages-handwritten.txt +++ b/docs/manual/adding-packages-handwritten.txt @@ -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) - diff --git a/linux/linux.mk b/linux/linux.mk index ae236d4..58cbe8e 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -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 diff --git a/package/Makefile.package.in b/package/Makefile.package.in index 33461b4..78fe3cc 100644 --- a/package/Makefile.package.in +++ b/package/Makefile.package.in @@ -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) diff --git a/package/cups/cups.mk b/package/cups/cups.mk index 4e8db71..9efd6e9 100644 --- a/package/cups/cups.mk +++ b/package/cups/cups.mk @@ -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) - diff --git a/package/fis/fis.mk b/package/fis/fis.mk index 2942449..0975f3f 100644 --- a/package/fis/fis.mk +++ b/package/fis/fis.mk @@ -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) diff --git a/package/games/doom-wad/doom-wads.mk b/package/games/doom-wad/doom-wads.mk index bae2420..c0bf4fb 100644 --- a/package/games/doom-wad/doom-wads.mk +++ b/package/games/doom-wad/doom-wads.mk @@ -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) diff --git a/package/gettext/gettext.mk b/package/gettext/gettext.mk index f4c8c76..f3605da 100644 --- a/package/gettext/gettext.mk +++ b/package/gettext/gettext.mk @@ -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) diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk index b68e825..ae442a0 100644 --- a/package/microperl/microperl.mk +++ b/package/microperl/microperl.mk @@ -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) - diff --git a/package/netkitbase/netkitbase.mk b/package/netkitbase/netkitbase.mk index dde8f9f..83991f2 100644 --- a/package/netkitbase/netkitbase.mk +++ b/package/netkitbase/netkitbase.mk @@ -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) diff --git a/package/netkittelnet/netkittelnet.mk b/package/netkittelnet/netkittelnet.mk index e9f40ca..ff05318 100644 --- a/package/netkittelnet/netkittelnet.mk +++ b/package/netkittelnet/netkittelnet.mk @@ -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) diff --git a/package/newt/newt.mk b/package/newt/newt.mk index eb944a9..ac450e0 100644 --- a/package/newt/newt.mk +++ b/package/newt/newt.mk @@ -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) - diff --git a/package/tinyhttpd/tinyhttpd.mk b/package/tinyhttpd/tinyhttpd.mk index 739849f..0f95d06 100644 --- a/package/tinyhttpd/tinyhttpd.mk +++ b/package/tinyhttpd/tinyhttpd.mk @@ -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) diff --git a/package/ttcp/ttcp.mk b/package/ttcp/ttcp.mk index 006b74c..1acf120 100644 --- a/package/ttcp/ttcp.mk +++ b/package/ttcp/ttcp.mk @@ -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) diff --git a/package/uemacs/uemacs.mk b/package/uemacs/uemacs.mk index 8355a7f..62b0911 100644 --- a/package/uemacs/uemacs.mk +++ b/package/uemacs/uemacs.mk @@ -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) diff --git a/package/vpnc/vpnc.mk b/package/vpnc/vpnc.mk index 5a8c700..d8d9654 100644 --- a/package/vpnc/vpnc.mk +++ b/package/vpnc/vpnc.mk @@ -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) - diff --git a/package/xfsprogs/xfsprogs.mk b/package/xfsprogs/xfsprogs.mk index 68db2f7..52fec09 100644 --- a/package/xfsprogs/xfsprogs.mk +++ b/package/xfsprogs/xfsprogs.mk @@ -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) diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk index 5eb7505..d9547fb 100644 --- a/toolchain/gcc/gcc-uclibc-4.x.mk +++ b/toolchain/gcc/gcc-uclibc-4.x.mk @@ -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) diff --git a/toolchain/gdb/gdb.mk b/toolchain/gdb/gdb.mk index 56faf49..b5c085b 100644 --- a/toolchain/gdb/gdb.mk +++ b/toolchain/gdb/gdb.mk @@ -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) diff --git a/toolchain/kernel-headers/kernel-headers.mk b/toolchain/kernel-headers/kernel-headers.mk index 72c6007..c464c37 100644 --- a/toolchain/kernel-headers/kernel-headers.mk +++ b/toolchain/kernel-headers/kernel-headers.mk @@ -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 diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk index 2ac4973..8f75fcf 100644 --- a/toolchain/toolchain-external/ext-tool.mk +++ b/toolchain/toolchain-external/ext-tool.mk @@ -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) diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk index ee474bb..32cbe46 100644 --- a/toolchain/uClibc/uclibc.mk +++ b/toolchain/uClibc/uclibc.mk @@ -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) -- 1.7.9 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-16 18:15 ` Alvaro G. M @ 2012-02-16 22:38 ` Arnout Vandecappelle 2012-02-17 8:27 ` Alvaro Gamez 0 siblings, 1 reply; 14+ messages in thread From: Arnout Vandecappelle @ 2012-02-16 22:38 UTC (permalink / raw) To: buildroot On Thursday 16 February 2012 19:15:07 Alvaro G. M wrote: > @@ -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 Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> -- 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-16 22:38 ` Arnout Vandecappelle @ 2012-02-17 8:27 ` Alvaro Gamez 2012-02-17 9:14 ` Arnout Vandecappelle 0 siblings, 1 reply; 14+ messages in thread From: Alvaro Gamez @ 2012-02-17 8:27 UTC (permalink / raw) To: buildroot 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 <arnout@mind.be> > On Thursday 16 February 2012 19:15:07 Alvaro G. M wrote: > > @@ -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 > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> > > -- > 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 > -- ?lvaro G?mez Machado -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120217/518d2d8e/attachment.html> ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-17 8:27 ` Alvaro Gamez @ 2012-02-17 9:14 ` Arnout Vandecappelle 2012-02-17 11:10 ` Alvaro G. M 0 siblings, 1 reply; 14+ messages in thread From: Arnout Vandecappelle @ 2012-02-17 9:14 UTC (permalink / raw) To: buildroot 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 -- 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-17 9:14 ` Arnout Vandecappelle @ 2012-02-17 11:10 ` Alvaro G. M 2012-02-18 12:09 ` Arnout Vandecappelle 0 siblings, 1 reply; 14+ messages in thread From: Alvaro G. M @ 2012-02-17 11:10 UTC (permalink / raw) To: buildroot From: "Alvaro G. M" <alvaro.gamez@hazent.com> 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. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Alvaro G. M <alvaro.gamez@hazent.com> --- 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(-) diff --git a/docs/manual/adding-packages-handwritten.txt b/docs/manual/adding-packages-handwritten.txt index a9d247c..583f303 100644 --- a/docs/manual/adding-packages-handwritten.txt +++ b/docs/manual/adding-packages-handwritten.txt @@ -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) - diff --git a/linux/linux.mk b/linux/linux.mk index ae236d4..58cbe8e 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -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 diff --git a/package/Makefile.package.in b/package/Makefile.package.in index 33461b4..a96031e 100644 --- a/package/Makefile.package.in +++ b/package/Makefile.package.in @@ -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) diff --git a/package/cups/cups.mk b/package/cups/cups.mk index 4e8db71..9efd6e9 100644 --- a/package/cups/cups.mk +++ b/package/cups/cups.mk @@ -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) - diff --git a/package/fis/fis.mk b/package/fis/fis.mk index 2942449..0975f3f 100644 --- a/package/fis/fis.mk +++ b/package/fis/fis.mk @@ -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) diff --git a/package/games/doom-wad/doom-wads.mk b/package/games/doom-wad/doom-wads.mk index bae2420..c0bf4fb 100644 --- a/package/games/doom-wad/doom-wads.mk +++ b/package/games/doom-wad/doom-wads.mk @@ -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) diff --git a/package/gettext/gettext.mk b/package/gettext/gettext.mk index f4c8c76..f3605da 100644 --- a/package/gettext/gettext.mk +++ b/package/gettext/gettext.mk @@ -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) diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk index b68e825..ae442a0 100644 --- a/package/microperl/microperl.mk +++ b/package/microperl/microperl.mk @@ -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) - diff --git a/package/netkitbase/netkitbase.mk b/package/netkitbase/netkitbase.mk index dde8f9f..83991f2 100644 --- a/package/netkitbase/netkitbase.mk +++ b/package/netkitbase/netkitbase.mk @@ -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) diff --git a/package/netkittelnet/netkittelnet.mk b/package/netkittelnet/netkittelnet.mk index e9f40ca..ff05318 100644 --- a/package/netkittelnet/netkittelnet.mk +++ b/package/netkittelnet/netkittelnet.mk @@ -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) diff --git a/package/newt/newt.mk b/package/newt/newt.mk index eb944a9..ac450e0 100644 --- a/package/newt/newt.mk +++ b/package/newt/newt.mk @@ -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) - diff --git a/package/tinyhttpd/tinyhttpd.mk b/package/tinyhttpd/tinyhttpd.mk index 739849f..0f95d06 100644 --- a/package/tinyhttpd/tinyhttpd.mk +++ b/package/tinyhttpd/tinyhttpd.mk @@ -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) diff --git a/package/ttcp/ttcp.mk b/package/ttcp/ttcp.mk index 006b74c..1acf120 100644 --- a/package/ttcp/ttcp.mk +++ b/package/ttcp/ttcp.mk @@ -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) diff --git a/package/uemacs/uemacs.mk b/package/uemacs/uemacs.mk index 8355a7f..62b0911 100644 --- a/package/uemacs/uemacs.mk +++ b/package/uemacs/uemacs.mk @@ -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) diff --git a/package/vpnc/vpnc.mk b/package/vpnc/vpnc.mk index 5a8c700..d8d9654 100644 --- a/package/vpnc/vpnc.mk +++ b/package/vpnc/vpnc.mk @@ -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) - diff --git a/package/xfsprogs/xfsprogs.mk b/package/xfsprogs/xfsprogs.mk index 68db2f7..52fec09 100644 --- a/package/xfsprogs/xfsprogs.mk +++ b/package/xfsprogs/xfsprogs.mk @@ -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) diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk index 5eb7505..d9547fb 100644 --- a/toolchain/gcc/gcc-uclibc-4.x.mk +++ b/toolchain/gcc/gcc-uclibc-4.x.mk @@ -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) diff --git a/toolchain/gdb/gdb.mk b/toolchain/gdb/gdb.mk index 56faf49..b5c085b 100644 --- a/toolchain/gdb/gdb.mk +++ b/toolchain/gdb/gdb.mk @@ -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) diff --git a/toolchain/kernel-headers/kernel-headers.mk b/toolchain/kernel-headers/kernel-headers.mk index 72c6007..c464c37 100644 --- a/toolchain/kernel-headers/kernel-headers.mk +++ b/toolchain/kernel-headers/kernel-headers.mk @@ -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 diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk index 2ac4973..8f75fcf 100644 --- a/toolchain/toolchain-external/ext-tool.mk +++ b/toolchain/toolchain-external/ext-tool.mk @@ -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) diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk index ee474bb..32cbe46 100644 --- a/toolchain/uClibc/uclibc.mk +++ b/toolchain/uClibc/uclibc.mk @@ -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) -- 1.7.9 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-17 11:10 ` Alvaro G. M @ 2012-02-18 12:09 ` Arnout Vandecappelle 2012-02-18 12:11 ` Alvaro Gamez 2012-02-18 12:15 ` Alvaro G. M 0 siblings, 2 replies; 14+ messages in thread From: Arnout Vandecappelle @ 2012-02-18 12:09 UTC (permalink / raw) To: buildroot Sorry, there are still a few things I missed before... On Friday 17 February 2012 12:10:01 Alvaro G. M wrote: [snip] > diff --git a/package/Makefile.package.in b/package/Makefile.package.in > index 33461b4..a96031e 100644 > --- a/package/Makefile.package.in > +++ b/package/Makefile.package.in > @@ -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. > 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)) 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-18 12:09 ` Arnout Vandecappelle @ 2012-02-18 12:11 ` Alvaro Gamez 2012-02-18 12:15 ` Alvaro G. M 1 sibling, 0 replies; 14+ messages in thread From: Alvaro Gamez @ 2012-02-18 12:11 UTC (permalink / raw) To: buildroot That's right. I can solve that in a moment. 2012/2/18 Arnout Vandecappelle <arnout@mind.be> > Sorry, there are still a few things I missed before... > > On Friday 17 February 2012 12:10:01 Alvaro G. M wrote: > > [snip] > > diff --git a/package/Makefile.package.in b/package/Makefile.package.in > > index 33461b4..a96031e 100644 > > --- a/package/Makefile.package.in > > +++ b/package/Makefile.package.in > > @@ -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. > > > 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)) > > 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 > -- ?lvaro G?mez Machado -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120218/91ed5f34/attachment.html> ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME 2012-02-18 12:09 ` Arnout Vandecappelle 2012-02-18 12:11 ` Alvaro Gamez @ 2012-02-18 12:15 ` Alvaro G. M 1 sibling, 0 replies; 14+ messages in thread From: Alvaro G. M @ 2012-02-18 12:15 UTC (permalink / raw) To: buildroot From: "Alvaro G. M" <alvaro.gamez@hazent.com> 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. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Alvaro G. M <alvaro.gamez@hazent.com> --- 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(-) diff --git a/docs/manual/adding-packages-handwritten.txt b/docs/manual/adding-packages-handwritten.txt index a9d247c..583f303 100644 --- a/docs/manual/adding-packages-handwritten.txt +++ b/docs/manual/adding-packages-handwritten.txt @@ -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) - diff --git a/linux/linux.mk b/linux/linux.mk index ae236d4..58cbe8e 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -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 diff --git a/package/Makefile.package.in b/package/Makefile.package.in index 33461b4..dd05224 100644 --- a/package/Makefile.package.in +++ b/package/Makefile.package.in @@ -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) diff --git a/package/cups/cups.mk b/package/cups/cups.mk index 4e8db71..9efd6e9 100644 --- a/package/cups/cups.mk +++ b/package/cups/cups.mk @@ -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) - diff --git a/package/fis/fis.mk b/package/fis/fis.mk index 2942449..0975f3f 100644 --- a/package/fis/fis.mk +++ b/package/fis/fis.mk @@ -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) diff --git a/package/games/doom-wad/doom-wads.mk b/package/games/doom-wad/doom-wads.mk index bae2420..c0bf4fb 100644 --- a/package/games/doom-wad/doom-wads.mk +++ b/package/games/doom-wad/doom-wads.mk @@ -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) diff --git a/package/gettext/gettext.mk b/package/gettext/gettext.mk index f4c8c76..f3605da 100644 --- a/package/gettext/gettext.mk +++ b/package/gettext/gettext.mk @@ -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) diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk index b68e825..ae442a0 100644 --- a/package/microperl/microperl.mk +++ b/package/microperl/microperl.mk @@ -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) - diff --git a/package/netkitbase/netkitbase.mk b/package/netkitbase/netkitbase.mk index dde8f9f..83991f2 100644 --- a/package/netkitbase/netkitbase.mk +++ b/package/netkitbase/netkitbase.mk @@ -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) diff --git a/package/netkittelnet/netkittelnet.mk b/package/netkittelnet/netkittelnet.mk index e9f40ca..ff05318 100644 --- a/package/netkittelnet/netkittelnet.mk +++ b/package/netkittelnet/netkittelnet.mk @@ -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) diff --git a/package/newt/newt.mk b/package/newt/newt.mk index eb944a9..ac450e0 100644 --- a/package/newt/newt.mk +++ b/package/newt/newt.mk @@ -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) - diff --git a/package/tinyhttpd/tinyhttpd.mk b/package/tinyhttpd/tinyhttpd.mk index 739849f..0f95d06 100644 --- a/package/tinyhttpd/tinyhttpd.mk +++ b/package/tinyhttpd/tinyhttpd.mk @@ -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) diff --git a/package/ttcp/ttcp.mk b/package/ttcp/ttcp.mk index 006b74c..1acf120 100644 --- a/package/ttcp/ttcp.mk +++ b/package/ttcp/ttcp.mk @@ -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) diff --git a/package/uemacs/uemacs.mk b/package/uemacs/uemacs.mk index 8355a7f..62b0911 100644 --- a/package/uemacs/uemacs.mk +++ b/package/uemacs/uemacs.mk @@ -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) diff --git a/package/vpnc/vpnc.mk b/package/vpnc/vpnc.mk index 5a8c700..d8d9654 100644 --- a/package/vpnc/vpnc.mk +++ b/package/vpnc/vpnc.mk @@ -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) - diff --git a/package/xfsprogs/xfsprogs.mk b/package/xfsprogs/xfsprogs.mk index 68db2f7..52fec09 100644 --- a/package/xfsprogs/xfsprogs.mk +++ b/package/xfsprogs/xfsprogs.mk @@ -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) diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk index 5eb7505..d9547fb 100644 --- a/toolchain/gcc/gcc-uclibc-4.x.mk +++ b/toolchain/gcc/gcc-uclibc-4.x.mk @@ -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) diff --git a/toolchain/gdb/gdb.mk b/toolchain/gdb/gdb.mk index 56faf49..b5c085b 100644 --- a/toolchain/gdb/gdb.mk +++ b/toolchain/gdb/gdb.mk @@ -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) diff --git a/toolchain/kernel-headers/kernel-headers.mk b/toolchain/kernel-headers/kernel-headers.mk index 72c6007..c464c37 100644 --- a/toolchain/kernel-headers/kernel-headers.mk +++ b/toolchain/kernel-headers/kernel-headers.mk @@ -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 diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk index 2ac4973..8f75fcf 100644 --- a/toolchain/toolchain-external/ext-tool.mk +++ b/toolchain/toolchain-external/ext-tool.mk @@ -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) diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk index ee474bb..32cbe46 100644 --- a/toolchain/uClibc/uclibc.mk +++ b/toolchain/uClibc/uclibc.mk @@ -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) -- 1.7.9 ^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2012-02-18 12:15 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-02-15 20:31 [Buildroot] [PATCH] DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME Alvaro Gamez 2012-02-15 20:36 ` Alvaro Gamez 2012-02-15 21:05 ` Arnout Vandecappelle 2012-02-15 23:40 ` Arnout Vandecappelle 2012-02-16 8:31 ` Alvaro Gamez 2012-02-16 9:07 ` Arnout Vandecappelle 2012-02-16 18:15 ` Alvaro G. M 2012-02-16 22:38 ` Arnout Vandecappelle 2012-02-17 8:27 ` Alvaro Gamez 2012-02-17 9:14 ` Arnout Vandecappelle 2012-02-17 11:10 ` Alvaro G. M 2012-02-18 12:09 ` Arnout Vandecappelle 2012-02-18 12:11 ` Alvaro Gamez 2012-02-18 12:15 ` Alvaro G. M
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox