config/global/download.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Aug 01 09:23:58 2008 +0000 (2008-08-01)
changeset 754 b13657cd64b3
parent 696 d8cb632212ee
child 1021 fa97295ee307
permissions -rw-r--r--
Rework a little bit of the LAN mirror and proxy settings.

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