Patchwork [1,of,6] pkg-download.mk: allow using localfiles outside of package infrastructure

login
register
mail settings
Submitter Thomas De Schampheleire
Date June 5, 2012, 7:22 p.m.
Message ID <5103c7c0451ff036f611.1338924132@beantl019720>
Download mbox | patch
Permalink /patch/163148/
State Superseded
Headers show

Comments

Thomas De Schampheleire - June 5, 2012, 7:22 p.m.
The localfiles download method uses $($(PKG)_SITE))) and
$($(PKG)_SOURCE) instead of $(1) and $(2). This means that it can only
be used for package downloads (through gentargets, autotargets, ...)
and not for other downloads like external toolchains.

This patch changes localfiles to allow this, just as the wget and scp
download methods already did.
For the version control download methods, nothing changes.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
 package/pkg-download.mk |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Thomas Petazzoni - June 6, 2012, 8:14 p.m.
Le Tue, 05 Jun 2012 21:22:12 +0200,
Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> a écrit :

> The localfiles download method uses $($(PKG)_SITE))) and
> $($(PKG)_SOURCE) instead of $(1) and $(2). This means that it can only
> be used for package downloads (through gentargets, autotargets, ...)
> and not for other downloads like external toolchains.
> 
> This patch changes localfiles to allow this, just as the wget and scp
> download methods already did.
> For the version control download methods, nothing changes.
> 
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

I generally agree with this, but for consistency sake, it should
probably done similarly for all other download methods, no? Of course,
it can be done later as separate patches, the code is already
inconsistent, so this patch does not make it worse from that
perspective.

Thomas
Thomas De Schampheleire - June 6, 2012, 8:18 p.m.
Op 6 jun. 2012 22:15 schreef "Thomas Petazzoni" <
thomas.petazzoni@free-electrons.com> het volgende:
>
> Le Tue, 05 Jun 2012 21:22:12 +0200,
> Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> a écrit :
>
> > The localfiles download method uses $($(PKG)_SITE))) and
> > $($(PKG)_SOURCE) instead of $(1) and $(2). This means that it can only
> > be used for package downloads (through gentargets, autotargets, ...)
> > and not for other downloads like external toolchains.
> >
> > This patch changes localfiles to allow this, just as the wget and scp
> > download methods already did.
> > For the version control download methods, nothing changes.
> >
> > Signed-off-by: Thomas De Schampheleire <
thomas.de.schampheleire@gmail.com>
>
> I generally agree with this, but for consistency sake, it should
> probably done similarly for all other download methods, no? Of course,
> it can be done later as separate patches, the code is already
> inconsistent, so this patch does not make it worse from that
> perspective.

Well, for wget and scp it was already ok, and I didn't think it made sense
for the git, bzr, hg and svn methods, as you'd only use these for packages,
right?

Best regards,
Thomas

Patch

diff --git a/package/pkg-download.mk b/package/pkg-download.mk
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -174,16 +174,16 @@  define SHOW_EXTERNAL_DEPS_WGET
 endef
 
 define DOWNLOAD_LOCALFILES
-	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
-		$(LOCALFILES) $(call qstrip,$(subst file://,,$($(PKG)_SITE)))/$($(PKG)_SOURCE) $(DL_DIR)
+	test -e $(DL_DIR)/$(2) || \
+		$(LOCALFILES) $(call qstrip,$(subst file://,,$(1))) $(DL_DIR)
 endef
 
 define SOURCE_CHECK_LOCALFILES
-  test -e $(call qstrip,$(subst file://,,$($(PKG)_SITE)))/$($(PKG)_SOURCE)
+  test -e $(call qstrip,$(subst file://,,$(1)))
 endef
 
 define SHOW_EXTERNAL_DEPS_LOCALFILES
-  echo $($(PKG)_SITE)/$($(PKG)_SOURCE)
+  echo $(2)
 endef
 
 ################################################################################