2003-12-22 19:29:21 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2004-01-07 10:47:13 +03:00
|
|
|
# $HEADER$
|
2003-12-22 19:29:21 +03:00
|
|
|
#
|
2004-07-07 16:45:36 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# This file is almost identical in functionality to
|
|
|
|
# ompi_get_version.sh. It is unfortunate that we have to duplicate code,
|
|
|
|
# but it is really the only what that I can think to do it. :-( Hence,
|
|
|
|
# if you change the logic here for determining version numbers, YOU MUST
|
|
|
|
# ALSO CHANGE IT IN ompi_get_version.sh!!
|
2003-12-22 19:29:21 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
srcfile="$1"
|
|
|
|
option="$2"
|
|
|
|
|
|
|
|
if test "$srcfile" = ""; then
|
|
|
|
option="--help"
|
|
|
|
else
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_MAJOR_VERSION="`cat $srcfile | grep major | cut -d= -f2`"
|
|
|
|
OMPI_MINOR_VERSION="`cat $srcfile | grep minor | cut -d= -f2`"
|
|
|
|
OMPI_RELEASE_VERSION="`cat $srcfile | grep release | cut -d= -f2`"
|
|
|
|
OMPI_ALPHA_VERSION="`cat $srcfile | grep alpha | cut -d= -f2`"
|
|
|
|
OMPI_BETA_VERSION="`cat $srcfile | grep beta | cut -d= -f2`"
|
|
|
|
OMPI_SVN_VERSION="`cat $srcfile | grep svn | cut -d= -f2`"
|
|
|
|
if test "$OMPI_RELEASE_VERSION" != "0" -a "$OMPI_RELEASE_VERSION" != ""; then
|
|
|
|
OMPI_VERSION="$OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION.$OMPI_RELEASE_VERSION"
|
2003-12-22 19:29:21 +03:00
|
|
|
else
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_VERSION="$OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION"
|
2003-12-22 19:29:21 +03:00
|
|
|
fi
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
if test "`expr $OMPI_ALPHA_VERSION \> 0`" = "1"; then
|
|
|
|
OMPI_VERSION="${OMPI_VERSION}a$OMPI_ALPHA_VERSION"
|
|
|
|
elif test "`expr $OMPI_BETA_VERSION \> 0`" = "1"; then
|
|
|
|
OMPI_VERSION="${OMPI_VERSION}b$OMPI_BETA_VERSION"
|
2003-12-22 19:29:21 +03:00
|
|
|
fi
|
|
|
|
|
2004-07-07 16:45:36 +04:00
|
|
|
if test "$OMPI_SVN_VERSION" != "0"; then
|
2004-03-26 07:25:54 +03:00
|
|
|
if test -d .svn; then
|
2004-08-10 02:37:17 +04:00
|
|
|
ver="r`svnversion .`"
|
2004-03-26 07:25:54 +03:00
|
|
|
else
|
|
|
|
ver="svn`date '+%m%d%Y'`"
|
|
|
|
fi
|
2004-06-17 04:43:54 +04:00
|
|
|
OMPI_SVN_VERSION="$ver"
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_VERSION="${OMPI_VERSION}$ver"
|
2003-12-22 19:29:21 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$option" = ""; then
|
|
|
|
option="--full"
|
2004-07-07 16:45:36 +04:00
|
|
|
fi
|
2003-12-22 19:29:21 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
case "$option" in
|
|
|
|
--full|-v|--version)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
|
|
|
--major)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_MAJOR_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
|
|
|
--minor)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_MINOR_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
|
|
|
--release)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_RELEASE_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
|
|
|
--alpha)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_ALPHA_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
|
|
|
--beta)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_BETA_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
2004-03-19 09:05:27 +03:00
|
|
|
--svn)
|
2004-06-07 19:33:53 +04:00
|
|
|
echo $OMPI_SVN_VERSION
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
2004-02-13 06:58:56 +03:00
|
|
|
--all)
|
2004-08-10 02:37:17 +04:00
|
|
|
echo ${OMPI_VERSION} ${OMPI_MAJOR_VERSION} ${OMPI_MINOR_VERSION} ${OMPI_RELEASE_VERSION} ${OMPI_ALPHA_VERSION} ${OMPI_BETA_VERSION} ${OMPI_SVN_VERSION}
|
2004-02-13 06:58:56 +03:00
|
|
|
;;
|
2003-12-22 19:29:21 +03:00
|
|
|
-h|--help)
|
|
|
|
cat <<EOF
|
|
|
|
$0 <srcfile> [<option>]
|
|
|
|
|
|
|
|
<srcfile> - Text version file
|
|
|
|
<option> - One of:
|
|
|
|
--full - Full version number
|
|
|
|
--major - Major version number
|
|
|
|
--minor - Minor version number
|
|
|
|
--release - Release version number
|
|
|
|
--alpha - Alpha version number
|
|
|
|
--beta - Beta version nmumber
|
2004-03-19 09:05:27 +03:00
|
|
|
--svn - Subversion repository number
|
2004-02-13 06:58:56 +03:00
|
|
|
--all - Show all version numbers, separated by :
|
2003-12-22 19:29:21 +03:00
|
|
|
--help - This message
|
|
|
|
EOF
|
|
|
|
esac
|
|
|
|
|
|
|
|
# All done
|
|
|
|
|
|
|
|
exit 0
|