From 702532d61decbfd868ab38c070b1c8ad3bfeb7c0 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 25 Jul 2008 10:02:43 +0000 Subject: 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(-) 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 +# Usage: CT_GetFileExtension [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 -- cgit v0.10.2-6-g49f6