# HG changeset patch # User "Yann E. MORIN" # Date 1217085288 0 # Node ID 65614732cfe7d1b7d2615354158f62cc59df88aa # Parent 823ac8f8e9fd05de4c821f7b2dd1f18f38d0f342 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(-) diff -r 823ac8f8e9fd -r 65614732cfe7 scripts/functions --- a/scripts/functions Sat Jul 26 15:12:33 2008 +0000 +++ b/scripts/functions Sat Jul 26 15:14:48 2008 +0000 @@ -262,18 +262,20 @@ } # 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 @@ -342,7 +344,7 @@ 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