* [Buildroot] [PATCH v2] Package downloads: allow restricting to primary site only
@ 2012-05-15 18:40 Thomas De Schampheleire
2012-05-15 20:44 ` Arnout Vandecappelle
0 siblings, 1 reply; 2+ messages in thread
From: Thomas De Schampheleire @ 2012-05-15 18:40 UTC (permalink / raw)
To: buildroot
This patch adds a new config option BR2_PRIMARY_SITE_ONLY that, when set,
restricts package downloads to the specified BR2_PRIMARY_SITE. If the package
is not present on the primary site, the download fails.
This is useful for project developers who want to ensure that the project can
be built even if the upstream tarball locations disappear.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
v2: update after moving of Makefile.package.in
Config.in | 12 ++++++++++++
package/pkg-download.mk | 7 +++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/Config.in b/Config.in
--- a/Config.in
+++ b/Config.in
@@ -119,6 +119,16 @@ config BR2_PRIMARY_SITE
NOTE: This works for all packages using the central package
infrastructure (generic, autotools, cmake, ...)
+config BR2_PRIMARY_SITE_ONLY
+ bool "Only allow downloads from primary download site"
+ help
+ If this option is enabled, downloads will only be attempted from the
+ primary download site. Other locations, like the package's official
+ download location or the backup download site, will not be
+ considered.
+
+if !BR2_PRIMARY_SITE_ONLY
+
config BR2_BACKUP_SITE
string "Backup download site"
default "http://sources.buildroot.net/"
@@ -175,6 +185,8 @@ config BR2_DEBIAN_MIRROR
Usually, just add your country code like XX here:
http://ftp.XX.debian.org
+endif
+
endmenu
config BR2_JLEVEL
diff --git a/package/pkg-download.mk b/package/pkg-download.mk
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -189,8 +189,8 @@ endef
################################################################################
# DOWNLOAD -- Download helper. Will try to download source from:
# 1) BR2_PRIMARY_SITE if enabled
-# 2) Download site
-# 3) BR2_BACKUP_SITE if enabled
+# 2) Download site, unless BR2_PRIMARY_SITE_ONLY is set
+# 3) BR2_BACKUP_SITE if enabled, unless BR2_PRIMARY_SITE_ONLY is set
#
# Argument 1 is the source location
# Argument 2 is the source filename
@@ -210,6 +210,9 @@ define DOWNLOAD_INNER
*) $(call $(DL_MODE)_WGET,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
esac ; \
fi ; \
+ if test "$(BR2_PRIMARY_SITE_ONLY)" = "y" ; then \
+ exit 1 ; \
+ fi ; \
if test -n "$(1)" ; then \
case "$($(PKG)_SITE_METHOD)" in \
git) $($(DL_MODE)_GIT) && exit ;; \
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH v2] Package downloads: allow restricting to primary site only
2012-05-15 18:40 [Buildroot] [PATCH v2] Package downloads: allow restricting to primary site only Thomas De Schampheleire
@ 2012-05-15 20:44 ` Arnout Vandecappelle
0 siblings, 0 replies; 2+ messages in thread
From: Arnout Vandecappelle @ 2012-05-15 20:44 UTC (permalink / raw)
To: buildroot
On 05/15/12 20:40, Thomas De Schampheleire wrote:
> This patch adds a new config option BR2_PRIMARY_SITE_ONLY that, when set,
> restricts package downloads to the specified BR2_PRIMARY_SITE. If the package
> is not present on the primary site, the download fails.
>
> This is useful for project developers who want to ensure that the project can
> be built even if the upstream tarball locations disappear.
>
> Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@gmail.com>
Acked-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] 2+ messages in thread
end of thread, other threads:[~2012-05-15 20:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-15 18:40 [Buildroot] [PATCH v2] Package downloads: allow restricting to primary site only Thomas De Schampheleire
2012-05-15 20:44 ` Arnout Vandecappelle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox