xcat-core/perl-xCAT/modifyUtils

28 lines
820 B
Plaintext
Raw Normal View History

#!/bin/sh
# Put the version, svn revision #, and build date into the Version function in Version.pm
2014-04-02 20:50:41 +00:00
if [ -z "$2" ]
then
echo "modifyUtils: Error: must specify the xCAT version as an argument" >&2
exit
fi
VER=$1
GITREF="git commit $2, "
BUILDDATE=`date`
#echo ". '(built $BUILDDATE)'"
if [ "$(uname)" = "AIX" ]
then
2014-04-02 20:50:41 +00:00
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${GITREF}built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
mv xCAT/Version.pm.new xCAT/Version.pm
else
if [ -f "/etc/debian_version" ];then
FILENAME="debian/perl-xcat/opt/xcat/lib/perl/xCAT/Version.pm"
else
FILENAME="xCAT/Version.pm"
fi
2014-04-02 20:50:41 +00:00
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${GITREF}built $BUILDDATE)'"/ $FILENAME
fi