config/global/download_extract.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 06 20:30:49 2008 +0000 (2008-05-06)
changeset 492 ef8ef3493392
parent 487 ef82cb824406
child 508 4968462088aa
permissions -rw-r--r--
Add a new option to set connection timeout while downloading.

/trunk/scripts/functions | 16 8 8 0 ++++++++--------
/trunk/config/global/download_extract.in | 25 25 0 0 +++++++++++++++++++++++++
2 files changed, 33 insertions(+), 8 deletions(-)
     1 # Options specific to downloading and extracting 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 config ONLY_DOWNLOAD
    15     bool
    16     prompt "Stop after downloading tarballs"
    17     default n
    18     help
    19       Only download the tarballs. Exit once it done.
    20       
    21       Usefull to pre-retrieve the tarballs before going off-line.
    22 
    23 config CONNECT_TIMEOUT
    24     int
    25     prompt "connection timeout"
    26     default 10
    27     help
    28       From the curl manual:
    29         Maximum time in seconds that you allow the connection to the server to take.
    30 
    31       The scenario is as follows;
    32         - some enterprise networks have firewalls that prohibit FTP traffic, while
    33           still allowing HTTP
    34         - most download sites have http:// equivalent for the ftp:// URL
    35         - after this number of seconds, it is considered that the connection could
    36           not be established, and the next URL in the list is tried, until we reach
    37           an URL that will go through the firewall, most probably an http:// URL.
    38 
    39       If you have a slow network, you'd better set this value higher than the default
    40       10s. If you know a firewall is blocking connections, but your network is globally
    41       fast, you can try to lower this value to jump more quickly to allowed URLs. YMMV.
    42 
    43       Note that this value applies equally to wget if you have that installed.
    44 
    45       Of course, you'd be better off to use a proxy, as offered by the following
    46       choice of options.
    47 
    48 choice
    49     bool
    50     prompt "Proxy type"
    51     default PROXY_TYPE_NONE
    52 
    53 config PROXY_TYPE_NONE
    54     bool
    55     prompt "No proxy"
    56     help
    57       Select this option if you have a direct connection to the internet,
    58       or if you already set the environment adequately.
    59 
    60 config PROXY_TYPE_HTTP
    61     bool
    62     prompt "HTTP proxy"
    63     help
    64       Use an HTTP proxy to connect to to the internet.
    65       Only the http and ftp protocols will be tunneled through this
    66       proxy.
    67 
    68       Alternatively to setting this option, you can set and export the
    69       following variables in your environment:
    70         ftp_proxy=http://user:passwd@proxy.server:port/
    71         http_proxy=http://user:passwd@proxy.server:port/
    72         https_proxy=http://user:passwd@proxy.server:port/
    73 
    74 # Haha! Here is an interesting feature/bug of mconf!
    75 # The following config entries will be shown out-side the
    76 # choice menu!
    77 # To add a third entry in the choice menu, add it after the
    78 # if...endif conditional below, and so on for a fourth entry...
    79 if PROXY_TYPE_HTTP
    80 
    81 config PROXY_HOST
    82     string
    83     prompt "hostname/IP"
    84 
    85 config PROXY_PORT
    86     int
    87     prompt "port"
    88     default 8080
    89     
    90 config PROXY_USER
    91     string
    92     prompt "user name"
    93 
    94 config PROXY_PASS
    95     string
    96     prompt "password"
    97 
    98 endif # USE_HTTP_PROXY
    99 
   100 config PROXY_TYPE_SOCKS
   101     bool
   102     prompt "SOCKS 4/5 proxy (EXPERIMENTAL)"
   103     depends on EXPERIMENTAL
   104     help
   105       Use a Socks 4/5 proxy to connect to the internet.
   106       All protocols can get tunneled through this kind of proxy (depending
   107       on your proxy configuration, so;e do not allow all protocols, but
   108       chances are that protocols needed by crosstool-NG are allowed).
   109 
   110       Please note that the proxy you are using MUST be on the same subnet
   111       as your machine. That is, it must be reachable without a hop through
   112       any gate. If this is not the case, then do NOT use this option, and
   113       setup tsocks system-wide.
   114 
   115       Alternatively to setting this option, you can configure tsocks
   116       system-wide, and set and export the following variable in your
   117       environment:
   118         LD_PRELOAD=/path/to/your/tsocks-library.so
   119 
   120       This option makes use of the tsocks library. You will have to have tsocks
   121       installed on your system, of course.
   122 
   123       If you think you do not know what tsocks is, or how to configure it,
   124       chances are that you do not need to set this option.
   125 
   126 if PROXY_TYPE_SOCKS
   127 
   128 choice
   129     bool
   130     prompt "type"
   131     default PROXY_TYPE_SOCKS_SYS
   132 
   133 config PROXY_TYPE_SOCKS_SYS
   134     bool
   135     prompt "Use system settings"
   136     help
   137       Use that if tsocks is already configured on your system.
   138 
   139 config PROXY_TYPE_SOCKS_AUTO
   140     bool
   141     prompt "Auto (BROKEN)"
   142     depends on BROKEN
   143     help
   144       crosstool-NG will attempt to guess what type of SOCKS version
   145       the proxy speaks.
   146 
   147 config PROXY_TYPE_SOCKS_4
   148     bool
   149     prompt "SOCKS 4 (BROKEN)"
   150     depends on BROKEN
   151 
   152 config PROXY_TYPE_SOCKS_5
   153     bool
   154     prompt "SOCKS 5 (BROKEN)"
   155     depends on BROKEN
   156 
   157 endchoice
   158 
   159 if ! PROXY_TYPE_SOCKS_SYS
   160 
   161 config PROXY_HOST
   162     string
   163     prompt "hostname/IP"
   164 
   165 config PROXY_PORT
   166     int
   167     prompt "port"
   168     default 1080
   169 
   170 config PROXY_USER
   171     string
   172     prompt "user name"
   173 
   174 config PROXY_PASS
   175     string
   176     prompt "password"
   177 
   178 endif # ! PROXY_TYPE_SOCKS_SYS
   179 
   180 endif # USE_SOCKS_PROXY
   181 
   182 endchoice
   183 
   184 config PROXY_TYPE
   185     string
   186     default "none"      if PROXY_TYPE_NONE
   187     default "http"      if PROXY_TYPE_HTTP
   188     default "sockssys"  if PROXY_TYPE_SOCKS_SYS
   189     default "socksauto" if PROXY_TYPE_SOCKS_AUTO
   190     default "socks4"    if PROXY_TYPE_SOCKS_4
   191     default "socks5"    if PROXY_TYPE_SOCKS_5
   192 
   193 # Force restore indentation
   194 config BREAK_INDENT
   195     bool
   196     default n
   197 
   198 if ! ONLY_DOWNLOAD
   199 
   200 comment "Extracting"
   201 
   202 config FORCE_EXTRACT
   203     bool
   204     prompt "Force extractions"
   205     default n
   206     help
   207       Force extraction of already exctracted tarballs.
   208       
   209       Usefull if you suspect a previous extract did not complete (eg. broken
   210       tarball), or you added a new set of patches for this component.
   211 
   212 config ONLY_EXTRACT
   213     bool
   214     prompt "Stop after extracting tarballs"
   215     default n
   216     help
   217       Exit after unpacking and patching tarballs.
   218       
   219       Usefull to look at the code before doing the build itself.
   220 
   221 endif # ! ONLY_DOWNLOAD