diff options
author | Yann E. MORIN" <yann.morin.1998@free.fr> | 2012-08-12 07:45:42 -0400 |
---|---|---|
committer | Austin Morton <austinpmorton@gmail.com> | 2012-08-12 07:45:42 -0400 |
commit | 15bde07c864366a4c6ec12ddaf6587f9ee081a64 (patch) | |
tree | 1793dc5b7f6f55f56feb4a0c310c31d4ee744304 /scripts/functions | |
parent | cf8093447f728ee8b6f3375b7131800ebb688bfa (diff) | |
download | crosstool-ng-15bde07c864366a4c6ec12ddaf6587f9ee081a64.tar.gz crosstool-ng-15bde07c864366a4c6ec12ddaf6587f9ee081a64.tar.bz2 crosstool-ng-15bde07c864366a4c6ec12ddaf6587f9ee081a64.zip |
scripts: add option to only use the mirror
Currently, if downloads are forbidden, the mirror is still tried for.
Change this way:
- if downlaods forbidden, do not try neither upstream locations nor mirror
- add option to only use the mirror, and avoid upstream locations
Signed-off-by: Austin Morton <austinpmorton@gmail.com>
[yann.morin.1998@free.fr: broaden the if USE_MIRRORto enclode mirror location]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/functions b/scripts/functions index 4a91f7d8..9bbc753a 100644 --- a/scripts/functions +++ b/scripts/functions @@ -555,6 +555,12 @@ CT_GetFile() { fi # No, it does not... + # If not allowed to download from the Internet, don't + if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then + CT_DoLog DEBUG "Not allowed to download from the Internet, aborting ${file} download" + return 1 + fi + # Try to retrieve the file CT_DoLog EXTRA "Retrieving '${file}'" @@ -565,7 +571,7 @@ CT_GetFile() { URLS+=( "${CT_MIRROR_BASE_URL}" ) fi - if [ "${CT_FORBID_DOWNLOAD}" != "y" ]; then + if [ "${CT_FORCE_MIRROR}" != "y" ]; then URLS+=( "${@}" ) fi |