2009-01-28 15:42:14 +00:00
|
|
|
#!/bin/sh
|
2011-04-26 17:26:25 +00:00
|
|
|
# Put the version, svn revision #, and build date into the Version function in Version.pm
|
2009-01-28 15:42:14 +00:00
|
|
|
|
2012-03-07 11:37:58 +00:00
|
|
|
if [ -z "$2" ]
|
2009-01-28 15:42:14 +00:00
|
|
|
then
|
2012-03-07 11:37:58 +00:00
|
|
|
echo "modifyUtils: Error: must specify the xCAT version and svn revision number as arguments" >&2
|
2009-01-28 15:42:14 +00:00
|
|
|
exit
|
2012-03-07 11:37:58 +00:00
|
|
|
fi
|
|
|
|
|
2009-01-28 15:42:14 +00:00
|
|
|
VER=$1
|
2012-03-07 11:37:58 +00:00
|
|
|
SVNREF="svn r$2, "
|
2009-01-28 15:42:14 +00:00
|
|
|
|
2012-03-07 11:37:58 +00:00
|
|
|
#SVNINFO=`svn info 2>/dev/null|grep Revision`
|
2009-01-28 15:42:14 +00:00
|
|
|
#/bin/echo -e $SVNINFO
|
2012-03-07 11:37:58 +00:00
|
|
|
#if [ $? -ne 0 -a -f .svninfo ]; then
|
|
|
|
# SVNINFO=`cat .svninfo 2>/dev/null|grep Revision`
|
|
|
|
#fi
|
|
|
|
#if [ $? -eq 0 ]
|
|
|
|
# then
|
|
|
|
# SVNREF="svn r"`echo $SVNINFO|awk '{print $2}'`", "
|
|
|
|
# else
|
|
|
|
# SVNREF=""
|
|
|
|
# fi
|
|
|
|
|
2009-01-28 15:42:14 +00:00
|
|
|
BUILDDATE=`date`
|
|
|
|
#echo ". '(${SVNREF}built $BUILDDATE)'"
|
2009-01-28 20:26:03 +00:00
|
|
|
|
|
|
|
if [ "$(uname)" = "AIX" ]
|
|
|
|
then
|
2011-04-26 17:26:25 +00:00
|
|
|
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
|
|
|
|
mv xCAT/Version.pm.new xCAT/Version.pm
|
2009-01-28 20:26:03 +00:00
|
|
|
else
|
2011-04-26 17:26:25 +00:00
|
|
|
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm
|
2009-05-08 18:46:56 +00:00
|
|
|
fi
|