Gentoo Archives: gentoo-perl

From: Torsten Veller <tove@g.o>
To: gentoo-dev@l.g.o
Cc: gentoo-perl@l.g.o
Subject: [gentoo-perl] Ebuild- and CPAN-versions compatibility
Date: Wed, 29 Dec 2010 08:57:21
Message-Id: 20101229085631.GA6757@veller.net
1 CPAN and ebuild versions are ordered in different ways. The idea here is
2 to change the ebuild versions to be predictable and CPAN compatible.
3
4 CPAN versions exist as "decimal" and "dotted-integer" versions.
5
6 | # Decimal versions #
7 | \d+(\.d+)?
8 |
9 | Any version which "looks like a number"[...]. This
10 | also includes versions with a single decimal point[...]
11
12 1.19 < 1.191 < 1.2
13
14 | # Dotted-Integer Versions #
15 | v\d+(\.\d{1,3}){2,}
16 |
17 | These contain more than one decimal point[...]
18 | This is what is commonly used in most open source software as the
19 | "external" version[...] A leading 'v' character is now required
20
21 v1.9.0 < v1.10.0 < v1.10.0.1
22
23
24 These version objects can be compared by grouping three digits of the
25 decimal number to one integer part of the dotted-integer version...
26
27 1.19 = 1.190 = 1.190000 ~ v1.190.0
28 1.191 = 1.191 = 1.191000 ~ v1.191.0
29 1.2 = 1.200000 ~ v1.200.0
30
31 1.009 = 1.009000 ~ v1.9.0
32 1.01 = 1.010000 ~ v1.10.0
33 1.010000001 ~ v1.10.0.1
34
35 perl -wE'use version;@v=map{version->parse($_)}@ARGV;print map{$_->numify," ",$_->normal,"\n"}@v' \
36 1.19 1.191 1.2 1.9.0 1.10.0 1.10.0.1
37
38 Many CPAN distributions are released in decimal version format. Most of
39 the time it's no problem to use the same version as PV. Sometimes it is...[2]
40
41 I solved it by adding additional dots.
42 1.191 becomes 1.19.1, 5.251 becomes 5.2.5.1, depending on former
43 releases. By removing the additional dots from PV it's easy to get the
44 upstream decimal version. But it differs from perlish versions meaning.
45
46
47 The current list of outdated cpan packages[1] contains at least four
48 packages that need attention:
49 | App-CLI 0.08 0.313
50 | IO-AIO 3.65 3.7
51 | MARC-Charset 1.3 1.31
52 | Sphinx-Search 0.22 0.2401
53
54
55 Vincent Pit currently maintains a number of special version mappings[6] for
56 CPANPLUS-Dist-Gentoo[4][5] (creates ebuilds from the CPAN like g-cpan
57 does) and suggested to move to a predictable and CPAN-compatible
58 versioning scheme:
59 | if the version starts by 'v' or has at least two dots, then it's used
60 | as-is (thus 'v1.2' becames '1.2' and '1.2.3' stays the same) ; otherwise
61 | the version number is a float 1.xxxyyyzzz... which is mapped to
62 | 1.xxx.yyy.zzz with padding zeros if needed ('1.1' would become '1.100',
63 | and '1.0701' would be '1.070.100')
64 (whether 1.0701 becomes 1.070.100 or 1.70.100 has to be decided but
65 doesn't really matter.)
66
67 I like this but it also means:
68 - set the CPAN version inside the ebuilds
69 - touch a lot of ebuilds
70 - have some downgrades[3]
71 - some upstreams force 0.21 < 0.21.1 (which isn't true for cpan
72 versioning!). hopefully these are only historical issues.
73 - versions look different but mean the same
74 - fix tools like up2date-ng, g-cpan,...
75
76 Maybe we should start by fixing only the packages where the CPAN versions
77 weren't compatible with PMS? Instead of having mappings for many cases
78 we only need a list of packages with transformed versions?
79
80 Comments?
81
82
83 [0] https://github.com/gentoo-perl/wiki/wiki/version
84 [1] http://www.gentoo.org/proj/en/perl/outdated-cpan-packages.xml
85 [2] grep "^inherit.*versionator" dev-perl/**/*.ebuild | wc -l # 86
86 [3] find dev-perl -name "*.ebuild" | egrep "\.[0-9]{4,}" | wc -l # ~68 downgrades
87 [4] http://search.cpan.org/dist/CPANPLUS-Dist-Gentoo/
88 [5] https://github.com/gentoo-perl/perl-experimental/tree/master/dev-perl/CPANPLUS-Dist-Gentoo
89 [6] http://cpansearch.perl.org/src/VPIT/CPANPLUS-Dist-Gentoo-0.11/lib/CPANPLUS/Dist/Gentoo/Maps.pm

Replies

Subject Author
[gentoo-perl] Re: Ebuild- and CPAN-versions compatibility Torsten Veller <tove@g.o>