You are not logged in.

#1 2016-05-29 00:41:56

Salkay
Member
Registered: 2014-05-22
Posts: 411

[SOLVED] Sort order of pkgver

Hi, sometimes upstream uses use odd versioning, or transitions to a new scheme. What are the rules for PKGBUILD pkgver? How are these ordered? Can I preview whether my new version will be "newer" or "older" than the previous one?

==Edit==
I found a partial guide in the pacman man page.

Alphanumeric:
  1.0a < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0 < 1.0.a < 1.0.1
Numeric:
  1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0

However, it would be useful to know how it sorts in all cases (e.g. non-alphanumeric characters), and if we can test with a simple `LC_ALL=??? sort` on the command line.

Last edited by Salkay (2016-05-29 12:15:17)

Offline

#2 2016-05-29 03:00:56

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,853

Re: [SOLVED] Sort order of pkgver

pacman comes with the `vercmp` utility to "Compare package version numbers using pacman's version comparison logic." smile


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2016-05-29 11:57:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 22,053
Website

Re: [SOLVED] Sort order of pkgver

Salkay wrote:

sometimes upstream ... transitions to a new scheme

In those cases you'll may want to use an epoch number.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2016-05-29 12:15:02

Salkay
Member
Registered: 2014-05-22
Posts: 411

Re: [SOLVED] Sort order of pkgver

Eschwartz wrote:

pacman comes with the `vercmp` utility to "Compare package version numbers using pacman's version comparison logic." smile

Oh fantastic! That's perfect, thank you. I added some information to the wiki about this.

Trilby wrote:
Salkay wrote:

sometimes upstream ... transitions to a new scheme

In those cases you'll may want to use an epoch number.

Yes, I'll do so in that case. If the new version was "later" anyway, then I figured the epoch wouldn't be necessary… but I'd have to know if it were "later" first.

Thank you both for the information.

Offline

Board footer

Powered by FluxBB