scripts: correctly warn when the local tarballs directory does not exist
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Dec 14 19:17:37 2009 +0100 (2009-12-14)
changeset 1662ea3490d46f4e
parent 1660 991fc21dd3cf
child 1663 e94f4ffddd1d
scripts: correctly warn when the local tarballs directory does not exist

Warn about a missing local tarball directory, only if it was configured.
Avoid the spurious message:
Directory '${CT_LOCAL_TARBALLS_DIR}' does not exist.
Will not save downloaded tarballs to local storage.

Thanks to "Pedro I. Sanchez" <psanchez@colcan.ca> for pointing out the
issue:
http://sourceware.org/ml/crossgcc/2009-12/msg00011.html
scripts/crosstool-NG.sh.in
     1.1 --- a/scripts/crosstool-NG.sh.in	Thu Dec 10 15:09:13 2009 +0100
     1.2 +++ b/scripts/crosstool-NG.sh.in	Mon Dec 14 19:17:37 2009 +0100
     1.3 @@ -168,8 +168,10 @@
     1.4  fi
     1.5  
     1.6  # If the local tarball directory does not exist, say so, and don't try to save there!
     1.7 -if [ ! -d "${CT_LOCAL_TARBALLS_DIR}" ]; then
     1.8 -    CT_DoLog WARN "Directory '${CT_LOCAL_TARBALLS_DIR}' does not exist. Will not save downloaded tarballs to local storage."
     1.9 +if [    "${CT_SAVE_TARBALLS}" = "y"     \
    1.10 +     -a ! -d "${CT_LOCAL_TARBALLS_DIR}" ]; then
    1.11 +    CT_DoLog WARN "Directory '${CT_LOCAL_TARBALLS_DIR}' does not exist."
    1.12 +    CT_DoLog WARN "Will not save downloaded tarballs to local storage."
    1.13      CT_SAVE_TARBALLS=
    1.14  fi
    1.15