From 67db85d4db4fcd19d73d64be7843b5e36c04fe09 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 14 Jan 2020 15:15:31 -0500 Subject: [PATCH] Enable SRCONLY flag The lenovo build system explicitly builds rpms under each OS, so the makerpm skipping building the installed rpms saves a great deal of time --- makerpm | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/makerpm b/makerpm index 806c1b5d6..4959bd63e 100755 --- a/makerpm +++ b/makerpm @@ -69,7 +69,11 @@ function makenoarch { sed -i "s/^Release: .*/Release: 1/" $RPMNAME/$RPMNAME.spec tar --exclude .svn -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm - rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz --define "version $VER" $REL "$EASE" + if [ -z "$SRCONLY" ]; then + rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz --define "version $VER" $REL "$EASE" + else + rpmbuild $QUIET -ts $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz --define "version $VER" $REL "$EASE" + fi RC=$? if [ $RPMNAME = "xCAT-UI" ]; then @@ -168,7 +172,11 @@ function makexcat { rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER*rpm echo "Building $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER-snap*.$ARCH.rpm $EMBEDTXT..." - rpmbuild $QUIET -ba $RPMNAME/$RPMNAME.spec $TARGET --define "version $VER" $REL "$EASE" + if [ -z "$SRCONLY" ]; then + rpmbuild $QUIET -ba $RPMNAME/$RPMNAME.spec $TARGET --define "version $VER" $REL "$EASE" + else + rpmbuild $QUIET -bs $RPMNAME/$RPMNAME.spec $TARGET --define "version $VER" $REL "$EASE" + fi RC=$? if [ "$RPMNAME" = "xCAT" ]; then files=("bmcsetup" "getipmi") @@ -211,7 +219,11 @@ function makegenesis { cd - >/dev/null rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $EMBEDTXT..." - rpmbuild $QUIET -ba $DIR/$RPMNAME.spec --define "version $VER" $REL "$EASE" + if [ -z "$SRCONLY" ]; then + rpmbuild $QUIET -ba $DIR/$RPMNAME.spec --define "version $VER" $REL "$EASE" + else + rpmbuild $QUIET -bs $DIR/$RPMNAME.spec --define "version $VER" $REL "$EASE" + fi } function makegenesisscripts { @@ -233,7 +245,11 @@ function makegenesisscripts { echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$ARCH-$VER-snap*.noarch.rpm $EMBEDTXT..." sed -i "s/^Version: .*/Version: $XCATVER/" $DIR/$RPMNAME.spec sed -i "s/^Release: .*/Release: 1/" $DIR/$RPMNAME.spec - rpmbuild $QUIET -ba $DIR/$RPMNAME.spec $TARGET --define "version $VER" $REL "$EASE" + if [ -z "$SRCONLY" ]; then + rpmbuild $QUIET -ba $DIR/$RPMNAME.spec $TARGET --define "version $VER" $REL "$EASE" + else + rpmbuild $QUIET -bs $DIR/$RPMNAME.spec $TARGET --define "version $VER" $REL "$EASE" + fi }