diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-07-26 15:14:48 +0000 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-07-26 15:14:48 +0000 |
commit | 87108e02413f709f05ecb80534483e40b5bb1ccf (patch) | |
tree | 61725c5ceddb7a145b945a436a8a62dbc8f5691d /scripts/functions | |
parent | 25f9fdd5b367a5b3956980514c3a49049c58c103 (diff) | |
download | crosstool-ng-87108e02413f709f05ecb80534483e40b5bb1ccf.tar.gz crosstool-ng-87108e02413f709f05ecb80534483e40b5bb1ccf.tar.bz2 crosstool-ng-87108e02413f709f05ecb80534483e40b5bb1ccf.zip |
Backport #857 from trunk:
While retrieving files, propagate the preferred extension down to sub-functions.
/branches/1.2/scripts/functions | 8 5 3 0 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/functions b/scripts/functions index 9ec06936..c37a0c72 100644 --- a/scripts/functions +++ b/scripts/functions @@ -262,18 +262,20 @@ CT_DoYes() { } # Get the file name extension of a component -# Usage: CT_GetFileExtension <component_name-component_version> +# Usage: CT_GetFileExtension <component_name-component_version> [extension] # If found, echoes the extension to stdout # If not found, echoes nothing on stdout. CT_GetFileExtension() { local ext local file="$1" + shift + local first_ext="$1" CT_Pushd "${CT_TARBALLS_DIR}" # we need to also check for an empty extension for those very # peculiar components that don't have one (such as sstrip from # buildroot). - for ext in .tar.gz .tar.bz2 .tgz .tar ''; do + for ext in ${first_ext} .tar.gz .tar.bz2 .tgz .tar ''; do if [ -f "${file}${ext}" ]; then echo "${ext}" break @@ -342,7 +344,7 @@ CT_GetFile() { esac # Do we already have it? - ext=$(CT_GetFileExtension "${file}") + ext=$(CT_GetFileExtension "${file}" ${first_ext}) if [ -n "${ext}" ]; then CT_DoLog DEBUG "Already have '${file}'" return 0 |