[Buildroot] [PATCH 1/9 v2] pkg-infra: allow specifying the local tarball name when calling DOWNLOAD

Yann E. MORIN yann.morin.1998 at free.fr
Sat Dec 6 11:13:51 UTC 2014


Add a second optinal argument to the DOWNLOAD macro, to define the local
filename of the tarball.

If not specified, defaults to the basename of the remote URI.

This will be needed to be able to differentiate the upstream filename
from the local filename, which may differ in some cases.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Cc: Maxime Hadjinlian <maxime.hadjinlian at gmail.com>
Cc: Samuel Martin <s.martin49 at gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Cc: Peter Korsgaard <jacmet at uclibc.org>
Cc: Thomas De Schampheleire <patrickdepinguin at gmail.com>
Cc: Arnout Vandecappelle <arnout at mind.be>

---
Changes v1 -> v2:
  - retain the ability to not pass the local filename
---
 package/pkg-download.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index f3409bd..5bd8eac 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -245,13 +245,15 @@ endef
 # 3) BR2_BACKUP_SITE if enabled, unless BR2_PRIMARY_SITE_ONLY is set
 #
 # Argument 1 is the source location
+# Argument 2 is the local filename, without any path component, optional;
+#            if not specified, defaults to the basename of $(1)
 #
 # E.G. use like this:
 # $(call DOWNLOAD,$(FOO_SITE))
 ################################################################################
 
 define DOWNLOAD
-	$(call DOWNLOAD_INNER,$(1),$(notdir $(1)))
+	$(call DOWNLOAD_INNER,$(1),$(if $(2),$(2),$(notdir $(1))))
 endef
 
 define DOWNLOAD_INNER
-- 
1.9.1




More information about the buildroot mailing list