[ofa-general] [PATCH] management/make.dist: daily build updates

Sasha Khapyorsky sashak at voltaire.com
Sun Jul 6 17:02:46 PDT 2008


Daily versions will be generated in format:

  ${package}-${base_version}-${date}-${git_abbreviation}

For example: opensm-3.2.1-20080707-12af490

Tarball files will have a same names but with .tar.gz suffix.

Daily build will generate new tarball only when actual changes have been
made.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 make.dist |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/make.dist b/make.dist
index 29cee0c..2e67940 100755
--- a/make.dist
+++ b/make.dist
@@ -51,6 +51,12 @@ if [ -z "$1" ]; then usage; exit 1; fi
 
 if [ "$1" != "daily" -a "$1" != "release" ]; then usage; exit 1; fi
 
+git diff-index --quiet HEAD -- $package > /dev/null 2>&1
+if [ $? -eq 1 ] ; then
+	echo "git tree is dirty, please commit or undo the changes"
+	#exit 2
+fi
+
 if [ -z "$TARGETS" ]; then
 	TARGETS="libibcommon libibumad libibmad opensm infiniband-diags"
 fi
@@ -95,7 +101,6 @@ for target in $TARGETS; do
 # incrementally higher than the last officially released tarball.
 		RELEASE=1
 		echo $RELEASE > $TMPDIR/$target.release
-		TARBALL=$target-$VERSION.tar.gz
 
 		if [ ! -z "$2" ]; then
 			if [ $2 = "signed" ]; then
@@ -108,6 +113,16 @@ for target in $TARGETS; do
 		fi
 	elif [ "$1" = "daily" ]; then
 		DATE=`date +%Y%m%d`
+		git_rev=`./gen_ver.sh $target | sed -e 's/^'$VERSION'-//'`
+		VERSION=$VERSION-$DATE-$git_rev
+		if [ -f $TMPDIR/$target.gitrev ]; then
+			old_rev=`cat $TMPDIR/$target.gitrev`
+		fi
+		echo $git_rev > $TMPDIR/$target.gitrev
+		if [ "$old_rev" = "$git_rev" ] ; then
+			echo "No daily build is needed for '$target' ($git_rev)"
+			continue
+		fi
 		if [ -f $TMPDIR/$target.release ]; then
 			RELEASE=`cat $TMPDIR/$target.release`
 			RELEASE=`expr $RELEASE + 1`
@@ -116,12 +131,19 @@ for target in $TARGETS; do
 		fi
 		echo $RELEASE > $TMPDIR/$target.release
 		RELEASE=0.${RELEASE}.${DATE}git
-		TARBALL=$target-$VERSION-$RELEASE.tar.gz
+		cat $target/configure.in \
+		  | sed -e '/AC_INIT/s/'$target', .*,/'$target', '$VERSION',/' \
+		  > configure.in.new
+		diff $target/configure.in configure.in.new > /dev/null \
+		  || cat configure.in.new > $target/configure.in
 	fi
 
+	TARBALL=$target-$VERSION.tar.gz
+
 	echo "Creating $TMPDIR/$TARBALL"
 	( cd $target && ./autogen.sh &&
 	  RELEASE=$RELEASE TARBALL=$TARBALL ./configure &&
 	  make dist && mv $target-$VERSION.tar.gz $TMPDIR/$TARBALL ) ||
 	exit $?
+	git checkout $target/configure.in
 done
-- 
1.5.5.1.178.g1f811




More information about the general mailing list