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