From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PXrqr-0000XY-Po for garchives@archives.gentoo.org; Wed, 29 Dec 2010 08:57:46 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 27034E05EB; Wed, 29 Dec 2010 08:57:35 +0000 (UTC) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.39]) by pigeon.gentoo.org (Postfix) with ESMTP id E3E6CE044C; Wed, 29 Dec 2010 08:56:55 +0000 (UTC) Received: from [93.210.39.5] (helo=bullet.local) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1PXrq2-0001TW-Ru; Wed, 29 Dec 2010 09:56:55 +0100 Received: from localhost (unknown [127.0.0.1]) by bullet.local (Postfix) with ESMTP id 7863A8561; Wed, 29 Dec 2010 08:56:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at bullet.veller.net Received: from bullet.local ([127.0.0.1]) by localhost (bullet.veller.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rVv22wHPWJ2F; Wed, 29 Dec 2010 09:56:31 +0100 (CET) Received: by bullet.local (Postfix, from userid 1000) id 9B4C18562; Wed, 29 Dec 2010 09:56:31 +0100 (CET) Date: Wed, 29 Dec 2010 09:56:31 +0100 From: Torsten Veller To: gentoo-dev@lists.gentoo.org Cc: gentoo-perl@lists.gentoo.org Subject: [gentoo-dev] Ebuild- and CPAN-versions compatibility Message-ID: <20101229085631.GA6757@veller.net> Mail-Followup-To: gentoo-dev@lists.gentoo.org, gentoo-perl@lists.gentoo.org Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Face: ===_______=8)_=8)_______A_very_very_nice_face_______=8)_=8)_______=== Jabber-ID: tove@jabber.ccc.de X-PGP-Fingerprint: 0416 3C11 8D79 65B9 AAD0 2065 BBC7 14D1 9C67 CD96 User-Agent: Mutt/1.5.21 (2010-09-15) X-Df-Sender: 1067115 X-Archives-Salt: 7deacf57-f75a-45e1-a30a-5c8249850ce6 X-Archives-Hash: 1d41df79ccacb918941fc35ce807b83c 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