Simplify the mirror settings.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Apr 19 16:58:21 2009 +0000 (2009-04-19)
changeset 12946fe8df60cfa4
parent 1293 965237500806
child 1295 38cf339a6ad0
Simplify the mirror settings.

-------- diffstat follows --------
/trunk/scripts/functions | 7 3 4 0 ++---
/trunk/config/global/download.in | 60 14 46 0 +++++++++++-----------------------------------
2 files changed, 17 insertions(+), 50 deletions(-)
config/global/download.in
scripts/functions
     1.1 --- a/config/global/download.in	Sun Apr 19 16:38:30 2009 +0000
     1.2 +++ b/config/global/download.in	Sun Apr 19 16:58:21 2009 +0000
     1.3 @@ -42,65 +42,33 @@
     1.4        Obviously, nothing prevents you from using a mirror that is in fact
     1.5        *not* on your LAN, for example on another subnet of your company's
     1.6        network, or a mirror on the Internet.
     1.7 +
     1.8 +if USE_MIRROR
     1.9 +
    1.10 +config PREFER_MIRROR
    1.11 +    bool
    1.12 +    prompt "Prefer the mirror"
    1.13 +    default n
    1.14 +    help
    1.15 +      Say 'Y' here if you prefer the LAN miror over the upstream sources.
    1.16 +
    1.17 +config MIRROR_BASE_URL
    1.18 +    string
    1.19 +    prompt "Base URL"
    1.20 +    default ""
    1.21 +    help
    1.22 +      This is the base URL searched in for tarballs.
    1.23        
    1.24        I (Yann E. MORIN) have set up such a mirror to host snapshots of
    1.25        some components, when those snapshots are volatile on the upstream
    1.26        servers. The mirror is *slow*, because it is hosted behind an ADSL
    1.27        line. For the time being, I haven't set up bandwidth limitations,
    1.28        but should the mirror be abused, I will. Please avoid using my
    1.29 -      machine when you can...
    1.30 -      The mirror is available as (fill in those values in the fields
    1.31 -      below):
    1.32 -        host name: ymorin.is-a-geek.org
    1.33 -        base dir : /mirrors
    1.34 -
    1.35 -if USE_MIRROR
    1.36 -
    1.37 -config PREFER_MIRROR
    1.38 -    bool
    1.39 -    prompt "Prefer the LAN mirror"
    1.40 -    default n
    1.41 -    help
    1.42 -      Say 'Y' here if you prefer the LAN miror over the upstream sources.
    1.43 -
    1.44 -choice
    1.45 -    bool
    1.46 -    prompt "Server type:"
    1.47 -
    1.48 -config MIRROR_HTTP
    1.49 -    bool
    1.50 -    prompt "http"
    1.51 -
    1.52 -config MIRROR_FTP
    1.53 -    bool
    1.54 -    prompt "ftp"
    1.55 -
    1.56 -endchoice # Server type
    1.57 -
    1.58 -config MIRROR_SCHEME
    1.59 -    string
    1.60 -    default "http"  if MIRROR_HTTP
    1.61 -    default "ftp"   if MIRROR_FTP
    1.62 -
    1.63 -config MIRROR_HOSTNAME
    1.64 -    string
    1.65 -    prompt "hostname"
    1.66 -    default ""
    1.67 -    help
    1.68 -      Enter here the hostname on your LAN mirror.
    1.69 -
    1.70 -config MIRROR_BASE
    1.71 -    string
    1.72 -    prompt "Base directory"
    1.73 -    default ""
    1.74 -    help
    1.75 -      This is the base directory searched for for tarballs. If you enter
    1.76 -      /mirror, then the search is performed in the following directories
    1.77 -      on the server:
    1.78 -        /mirror/<name>/
    1.79 -        /mirror/
    1.80 +      machine when you can... Also, no guarantee is made as to its
    1.81 +      availability. Use at your own risks.
    1.82        
    1.83 -      where <name> is replaced with the actual package name.
    1.84 +      The mirror is available at:
    1.85 +        http://ymorin.is-a-geek.org/mirrors/
    1.86  
    1.87  config MIRROR_LS_R
    1.88      bool
     2.1 --- a/scripts/functions	Sun Apr 19 16:38:30 2009 +0000
     2.2 +++ b/scripts/functions	Sun Apr 19 16:58:21 2009 +0000
     2.3 @@ -409,10 +409,9 @@
     2.4      # Add URLs on the LAN mirror
     2.5      LAN_URLS=
     2.6      if [ "${CT_USE_MIRROR}" = "y" ]; then
     2.7 -        CT_TestOrAbort "Please set the LAN mirror hostname" -n "${CT_MIRROR_HOSTNAME}"
     2.8 -        CT_TestOrAbort "Please tell me where to find tarballs on the LAN mirror '${CT_MIRROR_HOSTNAME}'" -n "${CT_MIRROR_BASE}"
     2.9 -        LAN_URLS="${LAN_URLS} ${CT_MIRROR_SCHEME}://${CT_MIRROR_HOSTNAME}/${CT_MIRROR_BASE}/${file%-*}"
    2.10 -        LAN_URLS="${LAN_URLS} ${CT_MIRROR_SCHEME}://${CT_MIRROR_HOSTNAME}/${CT_MIRROR_BASE}"
    2.11 +        CT_TestOrAbort "Please set the mirror base URL" -n "${CT_MIRROR_BASE_URL}"
    2.12 +        LAN_URLS="${LAN_URLS} ${CT_MIRROR_BASE_URL}/${file%-*}"
    2.13 +        LAN_URLS="${LAN_URLS} ${CT_MIRROR_BASE_URL}"
    2.14  
    2.15          if [ "${CT_PREFER_MIRROR}" = "y" ]; then
    2.16              CT_DoLog DEBUG "Pre-pending LAN mirror URLs"