[Openais] [PATCH] corosync/trunk: fix/improve rpm package versioning

Jim Meyering jim at meyering.net
Fri Jun 26 02:02:50 PDT 2009


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.
>
> Solution:
>
> after investigation, the only natural and clean solution is to use the
> "svn previous tag" version number + a clean alpha tag.
>
> In order to address #1 we need to introduce an helper script
> (svn-helper.sh) to determine the last known tag in svn.
> the script will return "unknown" if it is not possible to determine
> those information or the tools to determine those information are not
> available.
>
> Makefile.am defines an RPMVERSION detected by svn-helper.sh. The value
> can be easily overridden at make srpm/rpm invokation time.
> For eg:
>
> make srpm RPMVERSION=x.y.z
>
> this is useful if svn-helper.sh can't detect the information and we need
> to create a specific rpm version.
>
> In order to address #2 we simply apply a regexp to filter out unrequired
> data.
>
> Fabio
>
> Index: svn-helper.sh
> ===================================================================
> --- svn-helper.sh	(revision 0)
> +++ svn-helper.sh	(revision 0)
> @@ -0,0 +1,38 @@
> +#!/bin/sh
> +
> +get_svn_data() {
> +	lastrev=0
> +	svn info ../tags/* | \

This doesn't work for me, probably since I have only the trunk.
Is there a way

svn info ../tags/* doesn't work for me, since I have only the trunk.

How about first check for ../tags, and if not there, use svn co to get
them into ./.cached-tags.  Or better still, don't look at ../ at all
and just checkout the tags.
> Index: Makefile.am
> ===================================================================
...
> +RPMVERSION		= $(shell sh ./svn-helper.sh)

That should $(srcdir)/-relative:

  RPMVERSION		= $(shell sh $(srcdir)/svn-helper.sh)

for people who do non-srcdir builds.


More information about the Openais mailing list