config/global/download.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 19 22:45:17 2008 +0000 (2008-07-19)
changeset 695 320862b2d6f1
parent 693 458facedc485
child 696 d8cb632212ee
permissions -rw-r--r--
Introduce using a LAN mirror for retrieving tarballs.

/trunk/scripts/functions | 40 36 4 0 ++++++++++++-
/trunk/config/global/download.in | 146 115 31 0 ++++++++++++++++++++++++++++++++++++----------
2 files changed, 151 insertions(+), 35 deletions(-)
     1 # Options specific to downloading packages
     2 
     3 comment "Downloading"
     4 
     5 config FORCE_DOWNLOAD
     6     bool
     7     prompt "Force downloads"
     8     default n
     9     help
    10       Force downloading tarballs, even if one already exists.
    11       
    12       Usefull if you suspect a tarball to be damaged.
    13 
    14 menuconfig USE_LAN_MIRROR
    15     bool
    16     prompt "Use LAN mirror"
    17     default n
    18     help
    19       If you have a machine on your LAN that mirrors some of the needed
    20       tarballs, you can say 'Y' here, and configure adequate values in
    21       the following options.
    22       
    23       Tarballs will be be preferably fetched from the LAN mirror, and if
    24       not found there, standard places will be searched for.
    25 
    26 if USE_LAN_MIRROR
    27 
    28 choice
    29     bool
    30     prompt "Server type:"
    31 
    32 config LAN_MIRROR_HTTP
    33     bool
    34     prompt "http"
    35 
    36 config LAN_MIRROR_FTP
    37     bool
    38     prompt "ftp"
    39 
    40 endchoice # Server type
    41 
    42 config LAN_MIRROR_SCHEME
    43     string
    44     default "http"  if LAN_MIRROR_HTTP
    45     default "ftp"   if LAN_MIRROR_FTP
    46 
    47 config LAN_MIRROR_HOSTNAME
    48     string
    49     prompt "hostname"
    50     depends on EXPERIMENTAL
    51     default  "localhost"
    52     help
    53       Enter here the hostname on your LAN mirror.
    54 
    55 config LAN_MIRROR_PATTERNS
    56     string
    57     prompt "locations patterns (READ HELP!)"
    58     default "/downloads /downloads/%pkg /downloads/%pkg/%ver /downloads/%pkg-%ver"
    59     help
    60       A space-separated list of patterns to find the tarballs on the
    61       LAN mirror.
    62 
    63       You can use the following 'variables', and they'll get replaced by
    64       adequate values:
    65         %pkg : name of the package
    66         %ver : version of the package
    67 
    68       Thus for gcc-4.2.4, %pkg will be replaced with 'gcc', and %ver with
    69       '4.2.4' (both without quotes). Thus if you entered the default
    70       pattern: "/downloads/%pkg/ /downloads/%pkg/%ver /downloads/%pkg-%ver"
    71       the tarball for gcc-4.2.4 would be searched for in:
    72         /downloads/gcc/
    73         /downloads/gcc/4.2.4/
    74         /downloads/gcc-4.2.4/
    75 
    76       Of course, if the files on the LAN mirror are really arranged in weird
    77       ways, entering a list of patterns will be tedious... But see below.
    78 
    79 config LAN_MIRROR_LS_R
    80     bool
    81     prompt "Use ls-lr.gz et al."
    82     default n
    83     help
    84       If the tarball was not found at any of the above locations, see if the
    85       server has a ls-lr.gz (or similar) file, and use that file to see if
    86       the tarball is listed somewhere in that file.
    87 
    88       Common file names looked for are:
    89         ls-lrRt.txt     (used at ftp.gnu.org)
    90         find.txt        (ditto)
    91         ls-lR
    92 
    93 endif # USE_LAN_MIRROR
    94 
    95 menuconfig USE_PROXY
    96     bool
    97     prompt "Proxy settings"
    98     default n
    99     help
   100       Say 'Y' here if you need to use a proxy to connect to the internet.
   101 
   102 if USE_PROXY
   103 
   104 choice
   105     bool
   106     prompt "Proxy type"
   107 
   108 config PROXY_TYPE_HTTP
   109     bool
   110     prompt "HTTP proxy"
   111     help
   112       Use an HTTP proxy to connect to to the internet.
   113       Only the http and ftp protocols will be tunneled through this
   114       proxy.
   115 
   116       Alternatively to setting this option, you can set and export the
   117       following variables in your environment:
   118         ftp_proxy=http://user:passwd@proxy.server:port/
   119         http_proxy=http://user:passwd@proxy.server:port/
   120         https_proxy=http://user:passwd@proxy.server:port/
   121 
   122 # Haha! Here is an interesting feature/bug of mconf!
   123 # The following config entries will be shown out-side the
   124 # choice menu!
   125 # To add a third entry in the choice menu, add it after the
   126 # if...endif conditional below, and so on for a fourth entry...
   127 if PROXY_TYPE_HTTP
   128 
   129 config PROXY_HOST
   130     string
   131     prompt "hostname/IP"
   132 
   133 config PROXY_PORT
   134     int
   135     prompt "port"
   136     default 8080
   137     
   138 config PROXY_USER
   139     string
   140     prompt "user name"
   141 
   142 config PROXY_PASS
   143     string
   144     prompt "password"
   145 
   146 endif # USE_HTTP_PROXY
   147 
   148 config PROXY_TYPE_SOCKS
   149     bool
   150     prompt "SOCKS 4/5 proxy (EXPERIMENTAL)"
   151     depends on EXPERIMENTAL
   152     help
   153       Use a Socks 4/5 proxy to connect to the internet.
   154       All protocols can get tunneled through this kind of proxy (depending
   155       on your proxy configuration, some do not allow all protocols, but
   156       chances are that protocols needed by crosstool-NG are allowed).
   157 
   158       Alternatively to setting this option, you can configure tsocks
   159       system-wide, and set and export the following variable in your
   160       environment:
   161         LD_PRELOAD=/path/to/your/tsocks-library.so
   162 
   163       This option makes use of the tsocks library. You will have to have tsocks
   164       installed on your system, of course.
   165 
   166       If you think you do not know what tsocks is, or how to configure it,
   167       chances are that you do not need to set this option.
   168 
   169 if PROXY_TYPE_SOCKS
   170 
   171 choice
   172     bool
   173     prompt "type"
   174     default PROXY_TYPE_SOCKS_SYS
   175 
   176 config PROXY_TYPE_SOCKS_SYS
   177     bool
   178     prompt "Use system settings"
   179     help
   180       Use that if tsocks is already configured on your system.
   181 
   182 config PROXY_TYPE_SOCKS_AUTO
   183     bool
   184     prompt "Auto"
   185     help
   186       crosstool-NG will attempt to guess what type of SOCKS version
   187       the proxy speaks.
   188 
   189 config PROXY_TYPE_SOCKS_4
   190     bool
   191     prompt "SOCKS 4"
   192 
   193 config PROXY_TYPE_SOCKS_5
   194     bool
   195     prompt "SOCKS 5"
   196 
   197 endchoice
   198 
   199 if ! PROXY_TYPE_SOCKS_SYS
   200 
   201 config PROXY_HOST
   202     string
   203     prompt "hostname/IP"
   204 
   205 config PROXY_PORT
   206     int
   207     prompt "port"
   208     default 1080
   209 
   210 config PROXY_USER
   211     string
   212     prompt "user name"
   213 
   214 config PROXY_PASS
   215     string
   216     prompt "password"
   217 
   218 endif # ! PROXY_TYPE_SOCKS_SYS
   219 
   220 endif # USE_SOCKS_PROXY
   221 
   222 endchoice
   223 
   224 endif # Proxy settings
   225 
   226 config PROXY_TYPE
   227     string
   228     default "none"      if ! USE_PROXY
   229     default "http"      if PROXY_TYPE_HTTP
   230     default "sockssys"  if PROXY_TYPE_SOCKS_SYS
   231     default "socksauto" if PROXY_TYPE_SOCKS_AUTO
   232     default "socks4"    if PROXY_TYPE_SOCKS_4
   233     default "socks5"    if PROXY_TYPE_SOCKS_5
   234 
   235 config CONNECT_TIMEOUT
   236     int
   237     prompt "connection timeout"
   238     default 10
   239     help
   240       From the curl manual:
   241         Maximum time in seconds that you allow the connection to the server to take.
   242 
   243       The scenario is as follows;
   244         - some enterprise networks have firewalls that prohibit FTP traffic, while
   245           still allowing HTTP
   246         - most download sites have http:// equivalent for the ftp:// URL
   247         - after this number of seconds, it is considered that the connection could
   248           not be established, and the next URL in the list is tried, until we reach
   249           an URL that will go through the firewall, most probably an http:// URL.
   250 
   251       If you have a slow network, you'd better set this value higher than the default
   252       10s. If you know a firewall is blocking connections, but your network is globally
   253       fast, you can try to lower this value to jump more quickly to allowed URLs. YMMV.
   254 
   255       Note that this value applies equally to wget if you have that installed.
   256 
   257       Of course, you'd be better off to use a proxy, as offered by the previous
   258       option.
   259 
   260 config ONLY_DOWNLOAD
   261     bool
   262     prompt "Stop after downloading tarballs"
   263     default n
   264     help
   265       Only download the tarballs. Exit once it done.
   266       
   267       Usefull to pre-retrieve the tarballs before going off-line.