[libc-eglibc] Fix testing for existing files bash_array
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jul 27 22:14:08 2009 +0200 (2009-07-27)
branchbash_array
changeset 14751626414b1662
parent 1430 933eee133cbf
child 1476 eded63022651
[libc-eglibc] Fix testing for existing files

To test for existing files, use "[ -f blabla ]", not "[ -a blabla ]"
Checking for a file exsitence with "-a" is a bashism.
Althoug we _are_ using bash, it's disturbing as it can be misread as
the 'and' operator. Fix by using "-f".
scripts/build/libc/eglibc.sh
     1.1 --- a/scripts/build/libc/eglibc.sh	Wed Jul 15 09:22:47 2009 +0200
     1.2 +++ b/scripts/build/libc/eglibc.sh	Mon Jul 27 22:14:08 2009 +0200
     1.3 @@ -41,18 +41,18 @@
     1.4      eglibc_ports="${CT_LIBC}-ports-${CT_LIBC_VERSION}.tar.bz2"
     1.5  
     1.6      # Check if every tarballs are already present
     1.7 -    if [ -a "${CT_TARBALLS_DIR}/${eglibc}" ]              && \
     1.8 -       [ -a "${CT_TARBALLS_DIR}/${eglibc_linuxthreads}" ] && \
     1.9 -       [ -a "${CT_TARBALLS_DIR}/${eglibc_localedef}" ]    && \
    1.10 -       [ -a "${CT_TARBALLS_DIR}/${eglibc_ports}" ]; then
    1.11 +    if [ -f "${CT_TARBALLS_DIR}/${eglibc}" ]              && \
    1.12 +       [ -f "${CT_TARBALLS_DIR}/${eglibc_linuxthreads}" ] && \
    1.13 +       [ -f "${CT_TARBALLS_DIR}/${eglibc_localedef}" ]    && \
    1.14 +       [ -f "${CT_TARBALLS_DIR}/${eglibc_ports}" ]; then
    1.15          CT_DoLog DEBUG "Already have 'eglibc-${CT_LIBC_VERSION}'"
    1.16          return 0
    1.17      fi
    1.18  
    1.19 -    if [ -a "${CT_LOCAL_TARBALLS_DIR}/${eglibc}" ]              && \
    1.20 -       [ -a "${CT_LOCAL_TARBALLS_DIR}/${eglibc_linuxthreads}" ] && \
    1.21 -       [ -a "${CT_LOCAL_TARBALLS_DIR}/${eglibc_localedef}" ]    && \
    1.22 -       [ -a "${CT_LOCAL_TARBALLS_DIR}/${eglibc_ports}" ]        && \
    1.23 +    if [ -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc}" ]              && \
    1.24 +       [ -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_linuxthreads}" ] && \
    1.25 +       [ -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_localedef}" ]    && \
    1.26 +       [ -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_ports}" ]        && \
    1.27         [ "${CT_FORCE_DOWNLOAD}" != "y" ]; then
    1.28          CT_DoLog DEBUG "Got 'eglibc-${CT_LIBC_VERSION}' from local storage"
    1.29          for file in ${eglibc} ${eglibc_linuxthreads} ${eglibc_localedef} ${eglibc_ports}; do