From a59afbc8afd293375a69fb9a9fc7ffcc1a8971ee Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 29 Jun 2006 19:52:38 +0000 Subject: [PATCH] Also allow .tar.bz2 files to snarf the version This commit was SVN r10572. --- contrib/dist/linux/buildswitcherrpm.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/dist/linux/buildswitcherrpm.sh b/contrib/dist/linux/buildswitcherrpm.sh index 50409171bb..59911ed18d 100755 --- a/contrib/dist/linux/buildswitcherrpm.sh +++ b/contrib/dist/linux/buildswitcherrpm.sh @@ -52,7 +52,15 @@ fi # first="`basename $tarball | cut -d- -f2`" -version="`echo $first | sed -e 's/\.tar\.gz//'`" +if test "`echo $first | fgrep .tar.gz`" != ""; then + version="`echo $first | sed -e 's/\.tar\.gz//'`" +elif test "`echo $first | fgrep .tar.bz2`" != ""; then + version="`echo $first | sed -e 's/\.tar\.bz2//'`" +else + echo Unable to determine version number from filename + echo This script only supports .tar.gz and .tar.bz2 filenames + exit 1 +fi unset first echo "--> Found Open MPI version: $version"