Add option to set default site to download package source from. FreeBSD ports mirrors...
authorArnar Mar Sigurðsson <antab@valka.is>
Sun, 1 Jun 2008 17:58:48 +0000 (17:58 -0000)
committerArnar Mar Sigurðsson <antab@valka.is>
Sun, 1 Jun 2008 17:58:48 +0000 (17:58 -0000)
Config.in
package/Makefile.autotools.in

index 42682ec297cc47dc571fa5b5d3ac1822a8491da8..79970932449e07423821024f5c7afd50b13fc9f3 100644 (file)
--- a/Config.in
+++ b/Config.in
@@ -15,6 +15,15 @@ source "target/device/Config.in"
 
 menu "Build options"
 
+config BR2_PRIMARY_SITE
+       string "Primary download site"
+       default ""
+       help
+         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.
+         NOTE: This only works for packages using the Makefile.autotools.in
+
 config BR2_WGET
        string "Wget command"
        default "wget --passive-ftp -nd"
index cf2ac7d239d7476e773fb3c967d27a5f9a876cb5..09c30958c7766b0a15f2e3f6c7f2b69c89fd48e9 100644 (file)
@@ -131,6 +131,9 @@ TAR ?= tar
 # Retrieve and unpack the archive
 $(BUILD_DIR)/%/.stamp_downloaded:
        $(call MESSAGE,"Downloading")
+ifdef BR2_PRIMARY_SITE
+       -$(Q)test -e $(DL_DIR)/$($(PKG)_SOURCE) || $(WGET) -P $(DL_DIR) $(BR2_PRIMARY_SITE)/$($(PKG)_SOURCE)
+endif
        $(Q)test -e $(DL_DIR)/$($(PKG)_SOURCE) || $(WGET) -P $(DL_DIR) $($(PKG)_SITE)/$($(PKG)_SOURCE)
        $(if $($(PKG)_PATCH),$(Q)test -e $(DL_DIR)/$($(PKG)_PATCH) || $(WGET) -P $(DL_DIR) $($(PKG)_SITE)/$($(PKG)_PATCH))
        $(Q)mkdir -p $(@D)