Ebuild- and CPAN-versions compatibility

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Ebuild- and CPAN-versions compatibility

Torsten Veller
CPAN and ebuild versions are ordered in different ways. The idea here is
to change the ebuild versions to be predictable and CPAN compatible.

CPAN versions exist as "decimal" and "dotted-integer" versions.

| # Decimal versions #
| \d+(\.d+)?
|
| Any version which "looks like a number"[...]. This
| also includes versions with a single decimal point[...]

  1.19 < 1.191 < 1.2

| # Dotted-Integer Versions #
| v\d+(\.\d{1,3}){2,}
|
| These contain more than one decimal point[...]
| This is what is commonly used in most open source software as the
| "external" version[...] A leading 'v' character is now required

  v1.9.0 < v1.10.0 < v1.10.0.1


These version objects can be compared by grouping three digits of the
decimal number to one integer part of the dotted-integer version...

1.19  = 1.190 = 1.190000  ~  v1.190.0
1.191 = 1.191 = 1.191000  ~  v1.191.0
1.2           = 1.200000  ~  v1.200.0

1.009         = 1.009000  ~  v1.9.0
1.01          = 1.010000  ~  v1.10.0
             1.010000001  ~  v1.10.0.1

perl -wE'use version;@v=map{version->parse($_)}@ARGV;print map{$_->numify," ",$_->normal,"\n"}@v' \
1.19 1.191 1.2 1.9.0 1.10.0 1.10.0.1

Many CPAN distributions are released in decimal version format. Most of
the time it's no problem to use the same version as PV. Sometimes it is...[2]

I solved it by adding additional dots.
1.191 becomes 1.19.1, 5.251 becomes 5.2.5.1, depending on former
releases. By removing the additional dots from PV it's easy to get the
upstream decimal version. But it differs from perlish versions meaning.


The current list of outdated cpan packages[1] contains at least four
packages that need attention:
| App-CLI         0.08    0.313
| IO-AIO          3.65    3.7
| MARC-Charset    1.3     1.31
| Sphinx-Search   0.22    0.2401


Vincent Pit currently maintains a number of special version mappings[6] for
CPANPLUS-Dist-Gentoo[4][5] (creates ebuilds from the CPAN like g-cpan
does) and suggested to move to a predictable and CPAN-compatible
versioning scheme:
| if the version starts by 'v' or has at least two dots, then it's used
| as-is (thus 'v1.2' becames '1.2' and '1.2.3' stays the same) ; otherwise
| the version number is a float 1.xxxyyyzzz... which is mapped to
| 1.xxx.yyy.zzz with padding zeros if needed ('1.1' would become '1.100',
| and '1.0701' would be '1.070.100')
(whether 1.0701 becomes 1.070.100 or 1.70.100 has to be decided but
doesn't really matter.)

I like this but it also means:
- set the CPAN version inside the ebuilds
- touch a lot of ebuilds
- have some downgrades[3]
- some upstreams force 0.21 < 0.21.1 (which isn't true for cpan
  versioning!). hopefully these are only historical issues.
- versions look different but mean the same
- fix tools like up2date-ng, g-cpan,...

Maybe we should start by fixing only the packages where the CPAN versions
weren't compatible with PMS? Instead of having mappings for many cases
we only need a list of packages with transformed versions?

Comments?


[0] https://github.com/gentoo-perl/wiki/wiki/version
[1] http://www.gentoo.org/proj/en/perl/outdated-cpan-packages.xml
[2] grep "^inherit.*versionator" dev-perl/**/*.ebuild | wc -l # 86
[3] find dev-perl -name "*.ebuild" | egrep "\.[0-9]{4,}" | wc -l # ~68 downgrades
[4] http://search.cpan.org/dist/CPANPLUS-Dist-Gentoo/
[5] https://github.com/gentoo-perl/perl-experimental/tree/master/dev-perl/CPANPLUS-Dist-Gentoo
[6] http://cpansearch.perl.org/src/VPIT/CPANPLUS-Dist-Gentoo-0.11/lib/CPANPLUS/Dist/Gentoo/Maps.pm

Reply | Threaded
Open this post in threaded view
|

Re: Ebuild- and CPAN-versions compatibility

Torsten Veller
* Torsten Veller <[hidden email]>:
> CPAN and ebuild versions are ordered in different ways. The idea here is
> to change the ebuild versions to be predictable and CPAN compatible.

I've committed dev-perl/Gentoo-PerlMod-Version which contains a perl module and
a scipt to convert the versions. gentoo-perlmod-version.pl maps given
perlish versions to ebuild versions (perl => ebuild):

$ gentoo-perlmod-version.pl 0.9 0.98 0.987 v0.{900,980,987} 0.{900,980,987}.0
0.9 => 0.900
0.98 => 0.980
0.987 => 0.987
v0.900 => 0.900
v0.980 => 0.980
v0.987 => 0.987
0.900.0 => 0.900
0.980.0 => 0.980
0.987.0 => 0.987

gentoo-perlmod-version.pl 0.9 0.08 0.007 0.0006 0.00005 0.000004 0.0000003
0.9 => 0.900
0.08 => 0.80
0.007 => 0.7
0.0006 => 0.0.600
0.00005 => 0.0.50
0.000004 => 0.0.4
0.0000003 => 0.0.0.300

Using version.pm the ebuild and perl versions can be compared:
The ebuild version just needs to be prefixed with a 'v'.
$ perl -wE 'while(@ARGV){say version->parse(shift) <=> version->parse(shift)}' v1.1 1.001 v1.190 1.19


The given perl distribution version will be recorded as MODULE_VERSION in
the ebuild. (For ease of use s/^MODULE_VERSION=(['"]?)(.+)\1/$2/ should
return the version if not PV.)

Diff of the perl-module.eclass is attached.


The change of versioning will result in ~22 downgrades:

$ find dev-perl -name "*.ebuild" | egrep '\.[1-9][0-9]{3}'
dev-perl/POE-Component-IKC/POE-Component-IKC-0.2200.ebuild
dev-perl/Class-Accessor-Grouped/Class-Accessor-Grouped-0.10000.ebuild
dev-perl/IO-Moose/IO-Moose-0.1004.ebuild
dev-perl/DBD-mysql/DBD-mysql-2.9007.ebuild
dev-perl/text-autoformat/text-autoformat-1.669002.ebuild
dev-perl/text-autoformat/text-autoformat-1.669001.ebuild
dev-perl/CPAN-Mini/CPAN-Mini-1.100630.ebuild
dev-perl/Tie-Cache-LRU/Tie-Cache-LRU-20081023.2116.ebuild
dev-perl/DateTime-Format-Strptime/DateTime-Format-Strptime-1.5000.ebuild
dev-perl/DateTime-Format-Strptime/DateTime-Format-Strptime-1.4000.ebuild
dev-perl/Net-Twitter/Net-Twitter-3.14001.ebuild
dev-perl/Net-Twitter/Net-Twitter-3.13009.ebuild
dev-perl/XML-RAI/XML-RAI-1.3031.ebuild
dev-perl/XML-RAI/XML-RAI-1.3022.ebuild
dev-perl/Algorithm-Diff/Algorithm-Diff-1.1902.ebuild
dev-perl/Throwable/Throwable-0.102080.ebuild
dev-perl/Email-Sender/Email-Sender-0.102370.ebuild
dev-perl/Email-Sender/Email-Sender-0.101760.ebuild
dev-perl/Convert-BER/Convert-BER-1.3200.ebuild
dev-perl/Convert-BER/Convert-BER-1.3101.ebuild
dev-perl/Scalar-Properties/Scalar-Properties-1.100860.ebuild
dev-perl/DateTime-Format-Mail/DateTime-Format-Mail-0.3001.ebuild
dev-perl/File-chdir/File-chdir-0.1002.ebuild
dev-perl/File-chdir/File-chdir-0.1003.ebuild
dev-perl/Net-Netmask/Net-Netmask-1.9015.ebuild
dev-perl/PlRPC/PlRPC-0.2020-r1.ebuild
dev-perl/SQL-Translator/SQL-Translator-0.11006.ebuild
dev-perl/SQL-Translator/SQL-Translator-0.11007.ebuild
dev-perl/Perl6-Junction/Perl6-Junction-1.40000.ebuild
dev-perl/MP3-Tag/MP3-Tag-0.9709.ebuild

perl-module.patch (4K) Download Attachment