2003-12-22 19:29:21 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2004-11-22 04:38:40 +03:00
|
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
# All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
# All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
# University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
# $COPYRIGHT$
|
|
|
|
#
|
|
|
|
# Additional copyrights may follow
|
|
|
|
#
|
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
|
2005-03-27 15:24:27 +04:00
|
|
|
# ompi_get_version.m4. 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.m4!!
|
2003-12-22 19:29:21 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
srcfile="$1"
|
|
|
|
option="$2"
|
|
|
|
|
|
|
|
if test "$srcfile" = ""; then
|
|
|
|
option="--help"
|
|
|
|
else
|
2005-03-27 15:23:08 +04:00
|
|
|
OMPI_MAJOR_VERSION="`cat $srcfile | egrep '^major=' | cut -d= -f2`"
|
|
|
|
OMPI_MINOR_VERSION="`cat $srcfile | egrep '^minor=' | cut -d= -f2`"
|
|
|
|
OMPI_RELEASE_VERSION="`cat $srcfile | egrep '^release=' | cut -d= -f2`"
|
|
|
|
OMPI_ALPHA_VERSION="`cat $srcfile | egrep '^alpha=' | cut -d= -f2`"
|
|
|
|
OMPI_BETA_VERSION="`cat $srcfile | egrep '^beta=' | cut -d= -f2`"
|
|
|
|
OMPI_WANT_SVN="`cat $srcfile | egrep '^want_svn=' | cut -d= -f2`"
|
|
|
|
OMPI_SVN_R="`cat $srcfile | egrep '^svn_r=' | cut -d= -f2`"
|
2004-06-07 19:33:53 +04:00
|
|
|
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
|
|
|
|
|
2005-03-25 06:19:46 +03:00
|
|
|
if test "$OMPI_WANT_SVN" = "1"; then
|
2005-03-27 15:23:08 +04:00
|
|
|
if test "$OMPI_SVN_R" = "-1"; then
|
2005-03-25 06:19:46 +03:00
|
|
|
if test -d .svn; then
|
|
|
|
ver="r`svnversion .`"
|
|
|
|
else
|
|
|
|
ver="svn`date '+%m%d%Y'`"
|
|
|
|
fi
|
|
|
|
OMPI_SVN_R="$ver"
|
2004-03-26 07:25:54 +03:00
|
|
|
fi
|
2005-03-25 06:19:46 +03:00
|
|
|
OMPI_VERSION="${OMPI_VERSION}$OMPI_SVN_R"
|
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)
|
2005-03-25 06:19:46 +03:00
|
|
|
echo $OMPI_SVN_R
|
2003-12-22 19:29:21 +03:00
|
|
|
;;
|
2004-02-13 06:58:56 +03:00
|
|
|
--all)
|
2005-03-25 06:19:46 +03:00
|
|
|
echo ${OMPI_VERSION} ${OMPI_MAJOR_VERSION} ${OMPI_MINOR_VERSION} ${OMPI_RELEASE_VERSION} ${OMPI_ALPHA_VERSION} ${OMPI_BETA_VERSION} ${OMPI_SVN_R}
|
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
|