summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/global/download.in62
-rw-r--r--scripts/crosstool-NG.sh.in38
-rw-r--r--scripts/functions19
3 files changed, 66 insertions, 53 deletions
diff --git a/config/global/download.in b/config/global/download.in
index 801d06b..9f4b645 100644
--- a/config/global/download.in
+++ b/config/global/download.in
@@ -25,37 +25,6 @@ config FORCE_DOWNLOAD
Useful if you suspect a tarball to be damaged.
-config USE_MIRROR
- bool
- prompt "Use a mirror"
- help
- If you have a machine on your LAN that mirrors some of the needed
- tarballs, you can say 'Y' here, and configure adequate values in
- the following options.
-
- Obviously, nothing prevents you from using a mirror that is in fact
- *not* on your LAN, for example on another subnet of your company's
- network, or a mirror on the Internet.
-
-config MIRROR_BASE_URL
- string
- prompt "Base URL"
- depends on USE_MIRROR
- default "http://ymorin.is-a-geek.org/mirrors/"
- help
- This is the base URL searched in for tarballs.
-
- I (Yann E. MORIN) have set up such a mirror to host snapshots of
- some components, when those snapshots are volatile on the upstream
- servers. The mirror is *slow*, because it is hosted behind an ADSL
- line. For the time being, I haven't set up bandwidth limitations,
- but should the mirror be abused, I will. Please avoid using my
- machine when you can... Also, no guarantee is made as to its
- availability. Use at your own risks.
-
- The mirror is available at:
- http://ymorin.is-a-geek.org/mirrors/
-
config CONNECT_TIMEOUT
int
prompt "Connection timeout"
@@ -87,3 +56,34 @@ config ONLY_DOWNLOAD
Useful to pre-retrieve the tarballs before going off-line.
endif # ! FORBID_DOWNLOAD
+
+config USE_MIRROR
+ bool
+ prompt "Use a mirror"
+ help
+ If you have a machine on your LAN that mirrors some of the needed
+ tarballs, you can say 'Y' here, and configure adequate values in
+ the following options.
+
+ Obviously, nothing prevents you from using a mirror that is in fact
+ *not* on your LAN, for example on another subnet of your company's
+ network, or a mirror on the Internet.
+
+config MIRROR_BASE_URL
+ string
+ prompt "Base URL"
+ depends on USE_MIRROR
+ default "http://ymorin.is-a-geek.org/mirrors/"
+ help
+ This is the base URL searched in for tarballs.
+
+ I (Yann E. MORIN) have set up such a mirror to host snapshots of
+ some components, when those snapshots are volatile on the upstream
+ servers. The mirror is *slow*, because it is hosted behind an ADSL
+ line. For the time being, I haven't set up bandwidth limitations,
+ but should the mirror be abused, I will. Please avoid using my
+ machine when you can... Also, no guarantee is made as to its
+ availability. Use at your own risks.
+
+ The mirror is available at:
+ http://ymorin.is-a-geek.org/mirrors/
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index 509a74b..463a642 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -509,27 +509,23 @@ if [ -z "${CT_RESTART}" ]; then
fi
if [ -z "${CT_RESTART}" ]; then
- if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then
- CT_DoLog INFO "Downloading forbidden by configuration, skipping downloads"
- else
- CT_DoStep INFO "Retrieving needed toolchain components' tarballs"
- do_companion_tools_get
- do_kernel_get
- do_gmp_get
- do_mpfr_get
- do_ppl_get
- do_cloog_get
- do_mpc_get
- do_libelf_get
- do_binutils_get
- do_elf2flt_get
- do_sstrip_get
- do_cc_get
- do_libc_get
- do_debug_get
- do_test_suite_get
- CT_EndStep
- fi
+ CT_DoStep INFO "Retrieving needed toolchain components' tarballs"
+ do_companion_tools_get
+ do_kernel_get
+ do_gmp_get
+ do_mpfr_get
+ do_ppl_get
+ do_cloog_get
+ do_mpc_get
+ do_libelf_get
+ do_binutils_get
+ do_elf2flt_get
+ do_sstrip_get
+ do_cc_get
+ do_libc_get
+ do_debug_get
+ do_test_suite_get
+ CT_EndStep
if [ "${CT_ONLY_DOWNLOAD}" != "y" ]; then
if [ "${CT_FORCE_EXTRACT}" = "y" ]; then
diff --git a/scripts/functions b/scripts/functions
index 24bebb4..b95879c 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -540,7 +540,9 @@ CT_GetFile() {
URLS+=( "${CT_MIRROR_BASE_URL}" )
fi
- URLS+=( "${@}" )
+ if [ "${CT_FORBID_DOWNLOAD}" != "y" ]; then
+ URLS+=( "${@}" )
+ fi
# Scan all URLs in turn, and try to grab a tarball from there
# Do *not* try git trees (ext=/.git), this is handled in a specific
@@ -588,6 +590,11 @@ CT_GetCVS() {
return 0
fi
+ if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then
+ CT_DoLog WARN "Downloads forbidden, not trying cvs retrieval"
+ return 1
+ fi
+
CT_MktempDir tmp_dir
CT_Pushd "${tmp_dir}"
@@ -627,6 +634,11 @@ CT_GetSVN() {
return 0
fi
+ if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then
+ CT_DoLog WARN "Downloads forbidden, not trying svn retrieval"
+ return 1
+ fi
+
CT_MktempDir tmp_dir
CT_Pushd "${tmp_dir}"
@@ -652,6 +664,11 @@ CT_GetGit() {
local url
local cloned=0
+ if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then
+ CT_DoLog WARN "Downloads forbidden, not trying git retrieval"
+ return 1
+ fi
+
# Do we have it in our tarballs dir?
if [ -d "${CT_TARBALLS_DIR}/${basename}/.git" ]; then
CT_DoLog EXTRA "Updating git tree '${basename}'"