diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-10-31 18:27:27 (GMT) |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-10-31 18:27:27 (GMT) |
commit | 6bfe4b1550a1d4153c63aa480b37691d57fbd386 (patch) | |
tree | ab8c369e9653da603947bdfdd3dd703e8ff57649 /scripts/functions | |
parent | ef2e479e1d4540b3a563d6c0099138f3e7932f01 (diff) |
Transform LAN_MIRROR into plain MIRROR:
- it does not have to be in the LAN
- offer mirror preference over upstream
- if selected, the mirror will be scanned before upstream servers
- if not selected, upstream servers will be scanned before the mirror
- I've set up such an internet-accessible mirror
- uClibc snapshot available
- MPFR releases available (the MPFR site is down from time to time)
- update all samples to use my mirror as a failover
/trunk/scripts/functions | 45 16 29 0 +++++--------
/trunk/samples/x86_64-unknown-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/sh4-unknown-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/armeb-unknown-linux-uclibc/crosstool.config | 8 7 1 0 ++
/trunk/samples/arm-unknown-elf/crosstool.config | 8 7 1 0 ++
/trunk/samples/arm-unknown-linux-gnueabi/crosstool.config | 8 7 1 0 ++
/trunk/samples/ia64-unknown-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/x86_64-unknown-linux-uclibc/crosstool.config | 8 7 1 0 ++
/trunk/samples/armeb-unknown-linux-gnueabi/crosstool.config | 8 7 1 0 ++
/trunk/samples/powerpc-e500v2-linux-gnuspe/crosstool.config | 8 7 1 0 ++
/trunk/samples/i686-nptl-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/powerpc-unknown-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/arm-unknown-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/mips-unknown-linux-uclibc/crosstool.config | 8 7 1 0 ++
/trunk/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config | 8 7 1 0 ++
/trunk/samples/armeb-unknown-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/powerpc-unknown_nofpu-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/powerpc-unknown-linux-uclibc/crosstool.config | 8 7 1 0 ++
/trunk/samples/arm-unknown-linux-uclibc/crosstool.config | 8 7 1 0 ++
/trunk/samples/i586-geode-linux-uclibc/crosstool.config | 8 7 1 0 ++
/trunk/samples/powerpc-405-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config | 8 7 1 0 ++
/trunk/samples/mipsel-unknown-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/arm-unknown-eabi/crosstool.config | 8 7 1 0 ++
/trunk/samples/alphaev56-unknown-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/samples/powerpc-860-linux-gnu/crosstool.config | 8 7 1 0 ++
/trunk/config/global/download.in | 42 25 17 0 +++++++-----
27 files changed, 216 insertions(+), 71 deletions(-)
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 45 |
1 files changed, 16 insertions, 29 deletions
diff --git a/scripts/functions b/scripts/functions index b1db160..75b2eaf 100644 --- a/scripts/functions +++ b/scripts/functions @@ -474,40 +474,27 @@ CT_GetFile() { # Not found locally, try from the network - # Start with LAN mirror - if [ "${CT_USE_LAN_MIRROR}" = "y" ]; then - CT_DoSetProxy ${CT_LAN_MIRROR_USE_PROXY:+${CT_PROXY_TYPE}} - CT_DoLog DEBUG "Trying to retrieve a copy of '${file}' from LAN mirror '${CT_LAN_MIRROR_HOSTNAME}'" - CT_TestOrAbort "Please set the LAN mirror hostname" -n "${CT_LAN_MIRROR_HOSTNAME}" - CT_TestOrAbort "Please tell me where to find tarballs on the LAN mirror '${CT_LAN_MIRROR_HOSTNAME}'" -n "${CT_LAN_MIRROR_BASE}" - for ext in ${first_ext} .tar.bz2 .tar.gz .tgz .tar ''; do - # Please note: we just have the file's basename in a single piece. - # So we have to just try and split it back into name and version... :-( - for url in "${CT_LAN_MIRROR_SCHEME}://${CT_LAN_MIRROR_HOSTNAME}/${CT_LAN_MIRROR_BASE}/${file%-*}" \ - "${CT_LAN_MIRROR_SCHEME}://${CT_LAN_MIRROR_HOSTNAME}/${CT_LAN_MIRROR_BASE}"; \ - do - CT_DoLog DEBUG "Trying '${url}/${file}${ext}'" - CT_DoGetFile "${url}/${file}${ext}" - if [ -f "${file}${ext}" ]; then - CT_DoLog DEBUG "Got '${file}' from the LAN mirror" - if [ "${CT_SAVE_TARBALLS}" = "y" ]; then - # The file may already exist if downloads are forced: remove it first - CT_DoLog EXTRA "Saving '${file}' to local storage" - CT_DoExecLog ALL rm -f "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" - CT_DoExecLog ALL mv -f "${file}${ext}" "${CT_LOCAL_TARBALLS_DIR}" - CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" - fi - return 0 - fi - done - done + # Add URLs on the LAN mirror + LAN_URLS= + if [ "${CT_USE_MIRROR}" = "y" ]; then + CT_DoLog DEBUG "Trying to retrieve a copy of '${file}' from LAN mirror '${CT_MIRROR_HOSTNAME}'" + CT_TestOrAbort "Please set the LAN mirror hostname" -n "${CT_MIRROR_HOSTNAME}" + CT_TestOrAbort "Please tell me where to find tarballs on the LAN mirror '${CT_MIRROR_HOSTNAME}'" -n "${CT_MIRROR_BASE}" + LAN_URLS="${LAN_URLS} ${CT_MIRROR_SCHEME}://${CT_MIRROR_HOSTNAME}/${CT_MIRROR_BASE}/${file%-*}" + LAN_URLS="${LAN_URLS} ${CT_MIRROR_SCHEME}://${CT_MIRROR_HOSTNAME}/${CT_MIRROR_BASE}" + fi + + if [ "${CT_PREFER_MIRROR}" = "y" ]; then + URLS="${LAN_URLS} ${@}" + else + URLS="${@} ${LAN_URLS}" fi - # OK, available neither localy, nor from the LAN mirror (if any). + # Scan all URLs in turn, and try to grab a tarball from there CT_DoSetProxy ${CT_PROXY_TYPE} for ext in ${first_ext} .tar.bz2 .tar.gz .tgz .tar ''; do # Try all urls in turn - for url in "$@"; do + for url in ${URLS}; do CT_DoLog DEBUG "Trying '${url}/${file}${ext}'" CT_DoGetFile "${url}/${file}${ext}" if [ -f "${file}${ext}" ]; then |