scripts/functions: do not double check if downloads are allowed
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Nov 25 20:36:04 2009 +0100 (2009-11-25)
changeset 1689184a960d2fc8
parent 1688 ffdf4dc4b582
child 1690 9030e84dafad
scripts/functions: do not double check if downloads are allowed

Only call the *_get functions if downloads are allowed, so there
is no need to check it again in the retrieval wrappers.
scripts/crosstool-NG.sh.in
scripts/functions
     1.1 --- a/scripts/crosstool-NG.sh.in	Tue Jan 05 23:27:19 2010 +0100
     1.2 +++ b/scripts/crosstool-NG.sh.in	Wed Nov 25 20:36:04 2009 +0100
     1.3 @@ -489,19 +489,23 @@
     1.4  fi
     1.5  
     1.6  if [ -z "${CT_RESTART}" ]; then
     1.7 -    CT_DoStep INFO "Retrieving needed toolchain components' tarballs"
     1.8 -    do_kernel_get
     1.9 -    do_gmp_get
    1.10 -    do_mpfr_get
    1.11 -    do_ppl_get
    1.12 -    do_cloog_get
    1.13 -    do_mpc_get
    1.14 -    do_binutils_get
    1.15 -    do_cc_get
    1.16 -    do_libc_get
    1.17 -    do_tools_get
    1.18 -    do_debug_get
    1.19 -    CT_EndStep
    1.20 +    if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then
    1.21 +        CT_DoLog INFO "Downloading forbidden by configuration, skipping downloads"
    1.22 +    else
    1.23 +        CT_DoStep INFO "Retrieving needed toolchain components' tarballs"
    1.24 +        do_kernel_get
    1.25 +        do_gmp_get
    1.26 +        do_mpfr_get
    1.27 +        do_ppl_get
    1.28 +        do_cloog_get
    1.29 +        do_mpc_get
    1.30 +        do_binutils_get
    1.31 +        do_cc_get
    1.32 +        do_libc_get
    1.33 +        do_tools_get
    1.34 +        do_debug_get
    1.35 +        CT_EndStep
    1.36 +    fi
    1.37  
    1.38      if [ "${CT_ONLY_DOWNLOAD}" != "y" ]; then
    1.39          if [ "${CT_FORCE_EXTRACT}" = "y" ]; then
     2.1 --- a/scripts/functions	Tue Jan 05 23:27:19 2010 +0100
     2.2 +++ b/scripts/functions	Wed Nov 25 20:36:04 2009 +0100
     2.3 @@ -448,9 +448,6 @@
     2.4      CT_GetLocal "${file}" ${first_ext} && return 0 || true
     2.5      # No, it does not...
     2.6  
     2.7 -    # Are downloads allowed ?
     2.8 -    CT_TestAndAbort "File '${file}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y"
     2.9 -
    2.10      # Try to retrieve the file
    2.11      CT_DoLog EXTRA "Retrieving '${file}'"
    2.12      CT_Pushd "${CT_TARBALLS_DIR}"
    2.13 @@ -512,9 +509,6 @@
    2.14      CT_GetLocal "${basename}" && return 0 || true
    2.15      # No, it does not...
    2.16  
    2.17 -    # Are downloads allowed ?
    2.18 -    CT_TestAndAbort "File '${basename}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y"
    2.19 -
    2.20      CT_DoLog EXTRA "Retrieving '${basename}'"
    2.21  
    2.22      CT_MktempDir tmp_dir
    2.23 @@ -554,9 +548,6 @@
    2.24      CT_GetLocal "${basename}" && return 0 || true
    2.25      # No, it does not...
    2.26  
    2.27 -    # Are downloads allowed ?
    2.28 -    CT_TestAndAbort "File '${basename}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y"
    2.29 -
    2.30      CT_DoLog EXTRA "Retrieving '${basename}'"
    2.31  
    2.32      CT_MktempDir tmp_dir