diff --git a/perl-xCAT/modifyUtils b/perl-xCAT/modifyUtils index b96dd593e..bbad27bdb 100755 --- a/perl-xCAT/modifyUtils +++ b/perl-xCAT/modifyUtils @@ -1,20 +1,21 @@ #!/bin/sh # Put the version, svn revision #, and build date into the Version function in Version.pm -if [ -z "$1" ] +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 - sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new + 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 @@ -22,5 +23,5 @@ else else FILENAME="xCAT/Version.pm" fi - sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ $FILENAME + sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${GITREF}built $BUILDDATE)'"/ $FILENAME fi diff --git a/perl-xCAT/perl-xCAT.spec b/perl-xCAT/perl-xCAT.spec old mode 100644 new mode 100755 index 914e09bb0..0cef475ee --- a/perl-xCAT/perl-xCAT.spec +++ b/perl-xCAT/perl-xCAT.spec @@ -23,6 +23,8 @@ Provides: perl-xCAT = %{epoch}:%{version} Provides perl xCAT libraries for core functionality. Required for all xCAT installations. Includes xCAT::Table, xCAT::NodeRange, among others. +%define gitinfo %(git log -n 1 | head -n 1 | cut -f 2 -d ' ') + %define zvm %(if [ "$zvm" = "1" ];then echo 1; else echo 0; fi) %define fsm %(if [ "$fsm" = "1" ];then echo 1; else echo 0; fi) @@ -36,7 +38,7 @@ Includes xCAT::Table, xCAT::NodeRange, among others. %if %fsm %else # Modify the Version() function in xCAT/Utils.pm to automatically have the correct version -./modifyUtils %{version} +./modifyUtils %{version} %{gitinfo} # Build the pod version of the man pages for each DB table. It puts them in the man5 and man7 subdirs. # Then convert the pods to man pages and html pages.