On Fri, 2009-06-26 at 11:02 +0200, Jim Meyering wrote:
> Fabio M. Di Nitto wrote:
> > Hi,
> >
> > extra integration testing did show a series of issues with rpm
> > autogenerated version system.
> >
> > the following patch addresses them.
> >
> > Issues details:
> >
> > 1) a version trunk-1.r1234 is < 0.XX release breaking upgrade paths from
> > release X to trunk to release X+1.
> >
> > 2) alpha tag can contain M or S or MS. Eg. r1234M is < r1234 breaking
> > rpm upgrade path.
> >

#2 is still resolved with regexp.

#1 uses a radical and much simpler approach to the whole problem.

configure.ac used to export trunk as VERSION.

Set AC_INIT version to the last released version that will fit all kind
of purposes.

Update top level Makefile to handle releases and set the right version
trunk/.

Also cleanup the script by changing a bunch of ";" to && to make error
fatals (IIRC Jim reported this problem a long time ago but I never got
around to fix it). cols < 80 and white space cleanup.

NOTE: the only real new entry in the game is that top level makefile
will perform an automatic svn commit on trunk to Bump to the new release
version so that it happens before tagging (for proper ordering of events
in svn).

Fabio
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac	(revision 2301)
+++ trunk/configure.ac	(working copy)
@@ -4,7 +4,7 @@
 # bootstrap / init
 AC_PREREQ([2.61])
 
-AC_INIT([corosync], [trunk], [[email protected]])
+AC_INIT([corosync], [0.98], [[email protected]])
 AM_INIT_AUTOMAKE([-Wno-portability])
 
 AC_CONFIG_SRCDIR([lib/coroipcc.c])
Index: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	(revision 2301)
+++ trunk/Makefile.am	(working copy)
@@ -78,7 +78,7 @@
 $(SPEC): $(SPEC).in
 	rm -f $...@-t $@
 	LC_ALL=C date="$(shell date "+%a %b %d %Y")" && \
-	alphatag="$(shell svnversion)" && \
+	alphatag="$(shell svnversion | sed -e "s#.*:##g" -e "s#[MS]##g")" && \
 	sed \
 		-e "s...@alphatag@#r$$alphatag#g" \
 		-e "s...@version@#$(VERSION)#g" \
Index: Makefile
===================================================================
--- Makefile	(revision 2301)
+++ Makefile	(working copy)
@@ -13,16 +13,22 @@
 
 	## prepare the tarball
 	# set the correct version in configure.ac
-	sed -i -e 's#\[trunk\]#\['$(RELVERSION)'\]#' \
+	sed -i 's/\(AC_INIT[^,]*, \[\)[0-9.]*\(\].*\)/\1'$(RELVERSION)'\2/' \
 		trunk/configure.ac
 
 	# generate makefiles to have dist and distcheck targets
-	cd trunk ; ./autogen.sh ; ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib
-
 	# create tarball and test it
-	cd trunk ; make distcheck
+	cd trunk && \
+		./autogen.sh && \
+		./configure --prefix=/usr \
+			    --sysconfdir=/etc \
+			    --localstatedir=/var \
+			    --libdir=/usr/lib && \
+		make distcheck
 
 	## tag handling
+	cd trunk && \
+		svn commit -m "Bumping version to $(RELVERSION)"
 
 	# copy the tree from trunk
 	svn copy trunk tags/corosync-$(RELVERSION)
@@ -32,10 +38,13 @@
 	svn add tags/corosync-$(RELVERSION)/CHANGELOG
 
 	# set version
-	echo "#define RELEASE_RELVERSION \"subrev $(REV) corosync version $(RELVERSION)\"" > tags/corosync-$(RELVERSION)/version.h
+	echo "#define RELEASE_RELVERSION \"subrev $(REV) corosync version $(RELVERSION)\"" \
+		> tags/corosync-$(RELVERSION)/version.h
 
 	# make sure all files in the tarball are added to svn
-	cd tags ; tar -tf ../trunk/corosync-$(RELVERSION).tar.gz | xargs svn add
+	cd tags && \
+		tar -tf ../trunk/corosync-$(RELVERSION).tar.gz | \
+			xargs svn add
 
 	# create the final tarball from svn
 	svn export tags/corosync-$(RELVERSION) corosync-$(RELVERSION)
@@ -43,17 +52,13 @@
 
 	# publish the tarball
 	ssh developer.osdl.org mkdir -p /home/www/public_html/dev/openais/downloads/corosync-$(RELVERSION)
-	scp corosync-$(RELVERSION).tar.gz developer.osdl.org:/home/www/public_html/dev/openais/downloads/corosync-$(RELVERSION)
+	scp corosync-$(RELVERSION).tar.gz \
+		developer.osdl.org:/home/www/public_html/dev/openais/downloads/corosync-$(RELVERSION)
 	ssh developer.osdl.org chmod -R 755 /home/www/public_html/dev/openais/downloads/corosync-$(RELVERSION)
 
 	## clean up after the process
-	cd trunk; make maintainer-clean
-	sed -i -e 's#\['$(RELVERSION)'\]#\[trunk\]#' \
-		trunk/configure.ac
+	cd trunk && \
+		make maintainer-clean
 	rm -f trunk/corosync-$(RELVERSION).tar.gz
 
-	# be paranoid
-	@echo testing possible leftovers. the output of the following commands MUST be null
-	cd trunk; svn status
-
 .PHONY: trunk
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to