[aur-general] Standardized CPAN Package Versions

Justin Davis jrcd83 at gmail.com
Sun Feb 6 19:52:37 EST 2011

On Sun, Feb 6, 2011 at 5:16 PM, Xyne <xyne at archlinux.ca> wrote:
> Hi,
> I have CC'd this to aur-general as this concerns all CPAN packagers on Arch.
> CPAN package versions are a mess on Arch Linux. It seems that many if not most
> CPAN packagers on Arch are unaware of how CPAN deals with versions and thus
> they do not correctly translate the CPAN version. Most of the time a naive
> translation is used instead, and this prevents Pacman from working correctly.
> To give an example, CPAN considers "1.15" to be a later version than "1.23.0",
> whereas Pacman will consider the latter version the newer version. This is
> because "1.15" is short for "1.150" on CPAN, whereas "1.23.0" is short for
> "1.023.0". This can be confirmed using the "version" module[1].

Could you give real-life examples? I have not seen a case where CPAN
is confused by that. You seem to be saying that the packagers are at
fault here but I always blamed the CPAN module authors. From what I
remember, the biggest problem is when changing the number of digits.
For example, if you go 0.8, 0.9, to 0.10. Ding. Bad. Switching from
decimal to dotted decimal (multiple decimal points) also has problems.

Regarding the "version" module, ou will get different results using
the older "qv" function. I assume you are using the "parse"
class-method. Some old code still uses "qv" I imagine. I need to
convert some of mine, for example. I will have to look carefully at
this behavior before I do.

How do you know that CPAN uses the version module for comparing
versions? Again, do you have an example of bad version comparison CPAN
is performing?

Self-indulgent side-story: I once suspected CPAN used the date a
package was uploaded for comparing versions. This is half true. Look
at the Taint module: http://search.cpan.org/dist/Taint/ the only
example I know of. The latest version is older in age than the other
two versions on CPAN. Which one is downloaded? 0.9, the highest
version which is also the one with the oldest upload date. Which one
is displayed first? 0.7, the version uploaded most recently.

> I have written a simple Perl script[2] that addresses this issue.* It accepts
> CPAN versions as command-line arguments and prints out standardized Pacman
> package versions. The package versions enable Pacman to correctly compare CPAN
> packages, e.g. when resolving minimal dependencies.

Because I do not understand the problem very well I have a hard time
deciding if your script fixes it.

More information about the aur-general mailing list