mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 13:22:36 +00:00 
			
		
		
		
	Provide way to request git describe behavior
This commit is contained in:
		
				
					committed by
					
						
						Victor Hu
					
				
			
			
				
	
			
			
			
						parent
						
							edb1d181e9
						
					
				
				
					commit
					c4ca70b7d2
				
			
							
								
								
									
										14
									
								
								buildcore.sh
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								buildcore.sh
									
									
									
									
									
								
							@@ -172,9 +172,17 @@ else
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
function setversionvars {
 | 
			
		||||
    VER=`cat Version`
 | 
			
		||||
    SHORTVER=`cat Version|cut -d. -f 1,2`
 | 
			
		||||
    SHORTSHORTVER=`cat Version|cut -d. -f 1`
 | 
			
		||||
    if [ ! -z "$USEGITVER" ]; then
 | 
			
		||||
        VER=`git describe`
 | 
			
		||||
        VER=${GITVER/-/.post}
 | 
			
		||||
        VER=${VER/-/.}
 | 
			
		||||
    else
 | 
			
		||||
        VER=`cat Version`
 | 
			
		||||
    fi
 | 
			
		||||
    XCATVER=$VER
 | 
			
		||||
    export XCATVER
 | 
			
		||||
    SHORTVER=`echo $VER|cut -d. -f 1,2`
 | 
			
		||||
    SHORTSHORTVER=`echo $VER|cut -d. -f 1`
 | 
			
		||||
    BUILD_TIME=`date`
 | 
			
		||||
    BUILD_MACHINE=`hostname`
 | 
			
		||||
    COMMIT_ID=`git rev-parse --short HEAD`
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								makerpm
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								makerpm
									
									
									
									
									
								
							@@ -55,7 +55,7 @@ function makenoarch {
 | 
			
		||||
 | 
			
		||||
		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
 | 
			
		||||
		rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz --define "version $VER" $RELEASE
 | 
			
		||||
		RC=$?
 | 
			
		||||
 | 
			
		||||
		if [ $RPMNAME = "xCAT-UI" ]; then
 | 
			
		||||
@@ -137,7 +137,7 @@ 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
 | 
			
		||||
		rpmbuild $QUIET -ba $RPMNAME/$RPMNAME.spec $TARGET --define "version $VER" $RELEASE
 | 
			
		||||
		RC=$?
 | 
			
		||||
	fi
 | 
			
		||||
}
 | 
			
		||||
@@ -170,7 +170,7 @@ 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
 | 
			
		||||
	rpmbuild $QUIET -ba $DIR/$RPMNAME.spec --define "version $VER" $RELEASE
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function makegenesisscripts {
 | 
			
		||||
@@ -190,7 +190,7 @@ function makegenesisscripts {
 | 
			
		||||
	cd - >/dev/null
 | 
			
		||||
	rm -f $RPMROOT/SRPMS/$RPMNAME-$ARCH-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$ARCH-$VER*rpm
 | 
			
		||||
	echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$ARCH-$VER-snap*.noarch.rpm $EMBEDTXT..."
 | 
			
		||||
	rpmbuild $QUIET -ba $DIR/$RPMNAME.spec $TARGET
 | 
			
		||||
	rpmbuild $QUIET -ba $DIR/$RPMNAME.spec $TARGET --define "version $VER" $RELEASE
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -213,7 +213,12 @@ if [ -z "$1" ]; then
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
OSNAME=$(uname)
 | 
			
		||||
VER=`cat Version`
 | 
			
		||||
if [ -z "$XCATVER"] ; then
 | 
			
		||||
	VER=`cat Version`
 | 
			
		||||
        RELEASE="--define 'release 1'"
 | 
			
		||||
else
 | 
			
		||||
	VER=$XCATVER
 | 
			
		||||
fi
 | 
			
		||||
if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ];then
 | 
			
		||||
	QUIET=""
 | 
			
		||||
else
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user