fixed bld script in 2.7 to put rpms from diff branches in the correct place

This commit is contained in:
Bruce Potter 2013-08-14 11:59:38 -04:00
parent 2773b2cb0a
commit f98eee4e27
3 changed files with 26 additions and 33 deletions

View File

@ -70,6 +70,20 @@ if [ "$OSNAME" != "AIX" ]; then
export HOME=/root # This is so rpm and gpg will know home, even in sudo
fi
# for the git case, query the current branch and set REL (changing master to devel if necessary)
function setbranch {
#git checkout $BRANCH
REL=`git rev-parse --abbrev-ref HEAD`
if [ "$REL" = "master" ]; then
REL="devel"
fi
}
if [ "$REL" = "xcat-core" ]; then # using git
GIT=1
setbranch # this changes the REL variable
fi
# this is needed only when we are transitioning the yum over to frs
if [ "$FRSYUM" != 0 ]; then
YUMDIR=$FRS
@ -84,7 +98,11 @@ if [ -n "$EMBED" ]; then EMBEDDIR="/$EMBED"
else EMBEDDIR=""; fi
XCATCORE="xcat-core" # core-snap is a sym link to xcat-core
DESTDIR=../..$EMBEDDIR/$XCATCORE
if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms
DESTDIR=../../$REL$EMBEDDIR/$XCATCORE
else
DESTDIR=../..$EMBEDDIR/$XCATCORE
fi
SRCD=core-snap-srpms
# currently aix builds ppc rpms, but someday it should build noarch
@ -123,20 +141,9 @@ else
#echo "source=$source"
fi
# for the git case, query the current branch and set REL (changing master to devel if necessary)
function setbranch {
#git checkout $BRANCH
REL=`git rev-parse --abbrev-ref HEAD`
if [ "$REL" = "master" ]; then
REL="devel"
fi
}
# If they have not given us a premade update file, do an svn update or git pull and capture the results
SOMETHINGCHANGED=0
if [ "$REL" = "xcat-core" ]; then # using git
GIT=1
setbranch
if [ "$GIT" = "1" ]; then # using git
if [ -z "$GITUP" ]; then
GITUP=../coregitup
echo "git pull > $GITUP"

View File

@ -1,34 +1,21 @@
#!/bin/sh
# Put the version, svn revision #, and build date into the Version function in Version.pm
if [ -z "$2" ]
if [ -z "$1" ]
then
echo "modifyUtils: Error: must specify the xCAT version and svn revision number as arguments" >&2
echo "modifyUtils: Error: must specify the xCAT version as an argument" >&2
exit
fi
VER=$1
SVNREF="svn r$2, "
#SVNINFO=`svn info 2>/dev/null|grep Revision`
#/bin/echo -e $SVNINFO
#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
BUILDDATE=`date`
#echo ". '(${SVNREF}built $BUILDDATE)'"
#echo ". '(built $BUILDDATE)'"
if [ "$(uname)" = "AIX" ]
then
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
mv xCAT/Version.pm.new xCAT/Version.pm
else
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ xCAT/Version.pm
fi

View File

@ -24,7 +24,6 @@ Provides perl xCAT libraries for core functionality. Required for all xCAT inst
Includes xCAT::Table, xCAT::NodeRange, among others.
%define zvm %(if [ "$zvm" = "1" ];then echo 1; else echo 0; fi)
%define svninfo %(svn info | grep Revision | awk '{print $2}')
%prep
%setup -q -n perl-xCAT
@ -34,7 +33,7 @@ Includes xCAT::Table, xCAT::NodeRange, among others.
# as it is in svn.
# Modify the Version() function in xCAT/Utils.pm to automatically have the correct version
./modifyUtils %{version} %{svninfo}
./modifyUtils %{version}
# 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.