2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-06-25 00:40:48 +00:00
Files
xcat-core/perl-xCAT/modifyUtils
T
2026-06-20 18:48:14 -03:00

25 lines
716 B
Bash
Executable File

#!/bin/sh
# Put the version and git commit into the Version function in Version.pm
if [ -z "$2" ]
then
echo "modifyUtils: Error: must specify the xCAT version as an argument" >&2
exit
fi
VER=$1
GITREF="git commit $2"
if [ "$(uname)" = "AIX" ]
then
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' ($GITREF)'"/ 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
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' ($GITREF)'"/ $FILENAME
fi