config/global/download.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Jan 06 22:34:36 2009 +0000 (2009-01-06)
changeset 1131 b62d14d45fc4
parent 1022 7b3e8b8d392e
child 1292 546d2ed3410b
child 1366 5e5d1e6f55d3
permissions -rw-r--r--
Add an option to forbid downloads.
Idea and code-base from Don Elwell <don@manifoldlabs.com>, adapted by me.

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