Skip to contentSkip to conversation

pkg-download: support 'file://' in BR2_PRIMARY_SITE

PATCH New Jérôme Pouiller 2 participants 2 messages Nov 18, 2015 – Nov 19, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 pkg-download: support 'file://' in BR2_PRIMARY_SITE

This feature was already discuted here:

http://lists.busybox.net/pipermail/buildroot/2015-April/125419.html

Personally, I have a big central directory with all tarballs I have ever downloaded. I use this feature to isolate tarballs necessary to build a configuration:

make project_defconfig
make BR2_DL_DIR=/tmp/mirror-project BR2_PRIMARY_SITE=file:///home/user/dl source tar -C /tmp -czvf mirror-project.tgz mirror-project

---
v2:
- Update help message

 Config.in               | 6 ++++--
 package/pkg-download.mk | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)
Config.in +4 -2
index d795361..1809eeb 100644
@@ -165,8 +165,10 @@ config BR2_PRIMARY_SITE
 	  Primary site to download from. If this option is set then buildroot
 	  will try to download package source first from this site and try the
 	  default if the file is not found.
-	  Valid URIs are URIs recognized by $(WGET) and scp URIs of the form
-	  scp://[user@]host:path.
+	  Valid URIs are:
+	    - URIs recognized by $(WGET)
+	    - local URIs of the form file://absolutepath
+	    - scp URIs of the form scp://[user@]host:path.
 
 config BR2_PRIMARY_SITE_ONLY
 	bool "Only allow downloads from primary download site"
package/pkg-download.mk +1 -0
index c86b9ab..f08f616 100644
@@ -214,6 +214,7 @@ endef
 define DOWNLOAD_INNER
 	$(Q)if test -n "$(call qstrip,$(BR2_PRIMARY_SITE))" ; then \
 		case "$(call geturischeme,$(BR2_PRIMARY_SITE))" in \
+			file) $(call $(3)_LOCALFILES,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
 			scp) $(call $(3)_SCP,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
 			*) $(call $(3)_WGET,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
 		esac ; \
Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 1/1 pkg-download: support 'file://' in BR2_PRIMARY_SITE

Dear J?r?me Pouiller,

Quoted 8 lines · J?r?me Pouiller

This feature was already discuted here:

http://lists.busybox.net/pipermail/buildroot/2015-April/125419.html

Personally, I have a big central directory with all tarballs I have ever downloaded. I use this feature to isolate tarballs necessary to build a configuration:

Quoted 8 lines

make project_defconfig
make BR2_DL_DIR=/tmp/mirror-project BR2_PRIMARY_SITE=file:///home/user/dl source tar -C /tmp -czvf mirror-project.tgz mirror-project

---
v2:
- Update help message

Applied to next, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com