scripts/functions
changeset 210 98baeb928964
parent 182 223c84ec2d90
child 241 0aa95f4eed31
     1.1 --- a/scripts/functions	Sun Jul 01 19:04:20 2007 +0000
     1.2 +++ b/scripts/functions	Sat Jul 07 09:58:14 2007 +0000
     1.3 @@ -158,10 +158,18 @@
     1.4  # Test the presence of a tool, or abort if not found
     1.5  # Usage: CT_HasOrAbort <tool>
     1.6  CT_HasOrAbort() {
     1.7 -    CT_TestAndAbort "\"${1}\" not found and needed for successfull toolchain build." -z "`which \"${1}\"`"
     1.8 +    CT_TestAndAbort "\"${1}\" not found and needed for successfull toolchain build." -z "`CT_Which \"${1}\"`"
     1.9      return 0
    1.10  }
    1.11  
    1.12 +# Search a program: wrap "which" for those system where
    1.13 +# "which" verbosely says there is no match (Mdk are such
    1.14 +# suckers...)
    1.15 +# Usage: CT_Which <filename>
    1.16 +CT_Which() {
    1.17 +  which "$1" 2>/dev/null || true
    1.18 +}
    1.19 +
    1.20  # Get current date with nanosecond precision
    1.21  # On those system not supporting nanosecond precision, faked with rounding down
    1.22  # to the highest entire second
    1.23 @@ -292,8 +300,8 @@
    1.24  # Wrapper function to call one of curl or wget
    1.25  # Usage: CT_DoGetFile <URL>
    1.26  CT_DoGetFile() {
    1.27 -    local _wget=`which wget`
    1.28 -    local _curl=`which curl`
    1.29 +    local _wget=`CT_Which wget`
    1.30 +    local _curl=`CT_Which curl`
    1.31      case "${_wget},${_curl}" in
    1.32          ,)  CT_DoError "Could find neither wget nor curl";;
    1.33          ,*) CT_DoGetFileCurl "$1" 2>&1 |CT_DoLog ALL;;