[Mageia-dev] [soft-commits] [3012] Add ability to increase the version number of a given package

Olav Vitters olav at vitters.nl
Wed Feb 22 19:59:07 CET 2012


On Wed, Feb 22, 2012 at 06:13:12PM +0100, Thierry Vignaud wrote:
> On 22 February 2012 17:06,  <root at mageia.org> wrote:
> > Revision 3012 Author ovitters Date 2012-02-22 17:06:51 +0100 (Wed, 22 Feb
> > 2012)
> >
> > Log Message
> >
> > Add ability to increase the version number of a given package
> >
> > Command tries to be careful and does various checks (patches still apply,
> > etc)
> 
> Too sad it doesn't support this:
>   %define rel 3
>   %define release %mkrel %rel
> (which is hard anyway and should be rare though it does exist among
> mga packages)

I could support that or you can commit something to support this.
However, I want this mga-gnome to be very reliable. No "hope for the
best". IMO, paranoia is best... best to error out if anything might
appear strange.

> > +def version_cmp(a, b):
[..]
> Please do not reinvent the whell and do sg like this instead:
> 
> import rpm
> 
> def compare(t1, t2):
>    # t1 and t2 are tuples of (version, release)
>     v1, r1 = t1
>     v2, r2 = t2
>     return rpm.labelCompare(('1', v1, r1), ('1', v2, r2))

Cool! I knew there had to be something like this, but couldn't be
bothered to investigate. The version_cmp I just copy/pasted from some
Python code I wrote for GNOME.

-- 
Regards,
Olav


More information about the Mageia-dev mailing list