config/global/download.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Dec 13 23:32:39 2011 +0100 (2011-12-13)
branch1.13
changeset 2847 c0bf2319af08
parent 2595 d6b2354d9d17
child 3048 2858a24a5846
permissions -rw-r--r--
scripts: fix dumping execution backtrace

Dumping the backtrace has been broken since changeset #652e56d6d35a:
scripts: execute each steps in a subshell

We can spawn sub-sub-shells in some cases.

The way the fault handler works is to dump the backtrace, but to avoid
printing it once for every sub-shell (which could get quite confusing),
it simply exits when it detects that it is being run in a sub-shell,
leaving to the top-level shell the work to dump the backtrace.

Because each step is executed in its own sub-shell, the variable arrays
that contain the step name, the source file and line number, are lost
when exiting the per-step sub-shell.

Hence, the backtrace is currently limited to printing only the top-level
main procedure of the shell.

Fix this thus:
- when dumping the bckatraces for the steps & the functions, remember
it was dumped, and only dump it if it was not already dumped
- at the top-level shell, print the hints

Also, rename the top-level step label.

Reported-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 4193d6e6a17430a177fa88c287879c2c35e319f3)
     1 # Options specific to downloading packages
     2 
     3 comment "Downloading"
     4 
     5 config FORBID_DOWNLOAD
     6     bool
     7     prompt "Forbid downloads"
     8     help
     9       Normally, crosstool-NG will try to download missing tarballs (or
    10       checkout from CVS/SVN...).
    11       If you do not have network connectivity when you run crosstool-NG,
    12       and some files are missing, it can be a long time before crosstool-NG
    13       fails.
    14       
    15       Saying 'y' here will prevent crosstool-NG from downloading missing
    16       files, thus failing early so that you don't get stuck.
    17 
    18 if ! FORBID_DOWNLOAD
    19 
    20 config FORCE_DOWNLOAD
    21     bool
    22     prompt "Force downloads"
    23     help
    24       Force downloading tarballs, even if one already exists.
    25       
    26       Useful if you suspect a tarball to be damaged.
    27 
    28 config CONNECT_TIMEOUT
    29     int
    30     prompt "Connection timeout"
    31     default 10
    32     help
    33       From the curl manual:
    34         Maximum time in seconds that you allow the connection to the server to take.
    35       
    36       The scenario is as follows;
    37         - some enterprise networks have firewalls that prohibit FTP traffic, while
    38           still allowing HTTP
    39         - most download sites have http:// equivalent for the ftp:// URL
    40         - after this number of seconds, it is considered that the connection could
    41           not be established, and the next URL in the list is tried, until we reach
    42           an URL that will go through the firewall, most probably an http:// URL.
    43       
    44       If you have a slow network, you'd better set this value higher than the default
    45       10s. If you know a firewall is blocking connections, but your network is globally
    46       fast, you can try to lower this value to jump more quickly to allowed URLs. YMMV.
    47       
    48       Note that this value applies equally to wget if you have that installed.
    49 
    50 config ONLY_DOWNLOAD
    51     bool
    52     prompt "Stop after downloading tarballs"
    53     help
    54       Only download the tarballs. Exit once it done.
    55       
    56       Useful to pre-retrieve the tarballs before going off-line.
    57 
    58 endif # ! FORBID_DOWNLOAD
    59 
    60 config USE_MIRROR
    61     bool
    62     prompt "Use a mirror"
    63     help
    64       If you have a machine on your LAN that mirrors some of the needed
    65       tarballs, you can say 'Y' here, and configure adequate values in
    66       the following options.
    67       
    68       Obviously, nothing prevents you from using a mirror that is in fact
    69       *not* on your LAN, for example on another subnet of your company's
    70       network, or a mirror on the Internet.
    71 
    72 config MIRROR_BASE_URL
    73     string
    74     prompt "Base URL"
    75     depends on USE_MIRROR
    76     default "http://crosstool-ng.org/mirrors/"
    77     help
    78       This is the base URL searched in for tarballs.
    79       
    80       The crosstool-NG server hosts a few of the required components, but
    81       it is limited to volatile snashots (eg. uClibc) that are used in some
    82       samples, or to mirror some archives which upstream can be flaky (eg.
    83       mpfr), or for which upstream releases can be missing due to upstream
    84       not doing archives (eg. glibc-ports).
    85       
    86       The mirror is provided as-is, no guarantee is made as to the actual
    87       content of the archives, or to the availability of the mirror.
    88       
    89       Excercise caution, use at your own risks!
    90       
    91       The mirror is available at:
    92         http://crosstool-ng.org/mirrors/