diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-07-25 10:02:43 (GMT) |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-07-25 10:02:43 (GMT) |
commit | 702532d61decbfd868ab38c070b1c8ad3bfeb7c0 (patch) | |
tree | d0ff98240b52a3b6b9882dfd6d5cecd02e5ef7fe | |
parent | fd84c08021e4fe47ff8a88b56006d44016fdcf2a (diff) |
While retrieving files, propagate the preferred extension down to sub-functions.
/trunk/scripts/functions | 8 5 3 0 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
-rw-r--r-- | scripts/functions | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/functions b/scripts/functions index 3f7f941..e47b286 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 @@ -343,7 +345,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 |