1.1 --- a/config/global/download.in Sun Sep 16 14:12:22 2012 -0400
1.2 +++ b/config/global/download.in Sun Aug 12 07:45:42 2012 -0400
1.3 @@ -55,8 +55,6 @@
1.4
1.5 Useful to pre-retrieve the tarballs before going off-line.
1.6
1.7 -endif # ! FORBID_DOWNLOAD
1.8 -
1.9 config USE_MIRROR
1.10 bool
1.11 prompt "Use a mirror"
1.12 @@ -69,10 +67,19 @@
1.13 *not* on your LAN, for example on another subnet of your company's
1.14 network, or a mirror on the Internet.
1.15
1.16 +if USE_MIRROR
1.17 +
1.18 +config FORCE_MIRROR
1.19 + bool
1.20 + prompt "Only use mirror"
1.21 + help
1.22 + Only allow downloading from the mirror specified, other download locations
1.23 + will NOT be used, and the package will fail to be located if not present
1.24 + on the mirror provided
1.25 +
1.26 config MIRROR_BASE_URL
1.27 string
1.28 prompt "Base URL"
1.29 - depends on USE_MIRROR
1.30 default "http://crosstool-ng.org/mirrors/"
1.31 help
1.32 This is the base URL searched in for tarballs.
1.33 @@ -90,3 +97,7 @@
1.34
1.35 The mirror is available at:
1.36 http://crosstool-ng.org/mirrors/
1.37 +
1.38 +endif # USE_MIRROR
1.39 +
1.40 +endif # ! FORBID_DOWNLOAD
2.1 --- a/scripts/functions Sun Sep 16 14:12:22 2012 -0400
2.2 +++ b/scripts/functions Sun Aug 12 07:45:42 2012 -0400
2.3 @@ -555,6 +555,12 @@
2.4 fi
2.5 # No, it does not...
2.6
2.7 + # If not allowed to download from the Internet, don't
2.8 + if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then
2.9 + CT_DoLog DEBUG "Not allowed to download from the Internet, aborting ${file} download"
2.10 + return 1
2.11 + fi
2.12 +
2.13 # Try to retrieve the file
2.14 CT_DoLog EXTRA "Retrieving '${file}'"
2.15
2.16 @@ -565,7 +571,7 @@
2.17 URLS+=( "${CT_MIRROR_BASE_URL}" )
2.18 fi
2.19
2.20 - if [ "${CT_FORBID_DOWNLOAD}" != "y" ]; then
2.21 + if [ "${CT_FORCE_MIRROR}" != "y" ]; then
2.22 URLS+=( "${@}" )
2.23 fi
2.24