You are not logged in.

#1 2004-12-18 01:19:19

pjmattal
Forum Fellow
From: Boston, MA
Registered: 2003-12-24
Posts: 40

How does pacman compare version numbers?

I have a package whose version used to be 1.02b-4.

Now the new package is is version 1.1-2 in my repo.

Can someone explain to me why I get the following from pacman? How is it doing version counting?

:: itext-1.02b-4: local version is newer

Offline

#2 2004-12-18 20:38:56

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: How does pacman compare version numbers?

pygtk 2.4.1-2

this means the "normal" behaviour of "major-minor-revision" and the digit after "-" is arch' package version, this means that this is the second time pygtk is packaged and put in arch' repos,


arch + gentoo + initng + python = enlisy

Offline

#3 2004-12-18 23:35:33

apeiro
Daddy
From: Victoria, BC, Canada
Registered: 2002-08-12
Posts: 771
Website

Re: How does pacman compare version numbers?

You can use the vercmp utility to test pacman's version comparisons, if you want.  It returns an integer as a strcmp() call would.

[jvinet@mars misc]$ vercmp 1.02b 1.1
1

So pacman should see 1.1 as greater than 1.02b

[jvinet@mars misc]$ vercmp 1.12a 1.12
-1

Pacman considers trailing letters as pre-release versions, so 1.12a is less than 1.12.

Offline

#4 2004-12-19 00:22:21

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: How does pacman compare version numbers?

Just to make it really obvious:

1.02b-4 is the same as 1.2b-4.

Offline

#5 2004-12-19 00:36:00

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,366
Website

Re: How does pacman compare version numbers?

i3839 wrote:

Just to make it really obvious:

1.02b-4 is the same as 1.2b-4.

yep: strcmp() says 0 ;-) ... but this is not common sense (a trailing 0 is never common sense)


The impossible missions are the only ones which succeed.

Offline

#6 2004-12-19 10:55:39

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: How does pacman compare version numbers?

dp wrote:

yep: strcmp() says 0 ;-) ... but this is not common sense (a trailing 0 is never common sense)

If that the case with your strcmp() function then that's a bug. It should only be the case with strverscmp().

Offline

#7 2004-12-19 11:59:07

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: How does pacman compare version numbers?

isn't apeiro mixing the numbers in his explanation?

pjmattals package shouldn't been replaced with 1.1, should it!?


arch + gentoo + initng + python = enlisy

Offline

#8 2004-12-21 15:55:57

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: How does pacman compare version numbers?

the vercmp program uses the rpmvercmp routines (check the pacman source) which, though I haven't looked at the details, I would assume uses BCD style versioning.

so 1.02 translates:
atoi("1")=1, atoi("02") =2

just a guess.....

Offline

#9 2004-12-21 17:49:04

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: How does pacman compare version numbers?

phrakture wrote:

so 1.02 translates:
atoi("1")=1, atoi("02") =2

I've said that two days ago already...

Offline

Board footer

Powered by FluxBB