Re: [Rpm-maint] [PATCH] perl.{prov,req} improvments
On 14/09/17 10:53 +0200, Thierry Vignaud wrote: support-for-_-in-perl-module-version.diff: support for _ in perl module version This looks fairly obvious, too obvious in fact. Makes me wonder if its being omitted on purpose, but I've not a perl person and haven't got a clue about perl conventions. Ville (or others), thoughts? I'll let Jerome explain. Perl allows _ in numbers to separate thousands. $ perl -E 'say 1_000' 1000 (in fact, it can be used wherever one wants in a number: $ perl -E 'say 1_00' 100 ) This is allowed also in versions, so cpan authors often use 1.20_01 or 1.200_001 to have something that looks like semver (x.y.z) but is still parsed as a regular number. (yes, versioning sucks - I already wrote about it here http://jquelin.blogspot.fr/2009/05/rationalizing-perl-module-versions.html and that's why we are sanitizing perl version numbers within mageia) This patch only acknowledges this fact, and allows _ in versions. hth, Jérôme ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [PATCH] perl.{prov,req} improvments
On Thu, Sep 18, 2014 at 9:38 AM, Jerome Quelin jque...@gmail.com wrote: This patch only acknowledges this fact, and allows _ in versions. This results in the underscores also ending up in the Provides. I don't think that's a good thing as IIRC rpm's version comparison does not treat it the same way as perl does. So for example for module version spelled as 0.95_01 the Provides would also be perl($something) = 0.95_01. I suppose allowing the underscore would be ok if it would be sanitized before output, i.e. 0.95_01 would result in Provides perl($something) = 0.9501 ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [PATCH] perl.{prov,req} improvments
On Thu, Sep 18, 2014 at 1:38 PM, Michael Schroeder m...@suse.de wrote: Well, 0.95_01 is actually more correct than 0.9501. Perl's versions are actually more or less floating point numbers, thus 0.9501 is supposed to be less than 0.96. From rpm's side, '_' is exactly equivalent to '.', so 0.95_01 is the same as 0.95.01, which is probably what the upstream author indended. I see. I can see how this could work, but there are so many supposeds, probablys, guesses of intent and non-obvious assumptions involved that I'm just grateful that I don't have to be debugging any of this stuff unless I choose to, especially as IIRC there are no regression tests available for these beasts :) ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [PATCH] perl.{prov,req} improvments
On 09/15/2014 06:01 PM, Thierry Vignaud wrote: Hi Mageia just switched to internal deps generator (at least). In the process, I unforked as most scripts as possible. Here's some old fixes: skip-plain-regular-comments.diff: just skip plain, regular perl comments... What's the reproducer for the case where this is needed? At least in my trivial testcase, a comment is handled as it should, eg only perl(foo) is provided from package foo; #package bar; support-for-_-in-perl-module-version.diff: support for _ in perl module version This looks fairly obvious, too obvious in fact. Makes me wonder if its being omitted on purpose, but I've not a perl person and haven't got a clue about perl conventions. Ville (or others), thoughts? - Panu - ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [PATCH] perl.{prov,req} improvments
On 17 September 2014 10:39, Panu Matilainen pmati...@laiskiainen.org wrote: Mageia just switched to internal deps generator (at least). In the process, I unforked as most scripts as possible. Here's some old fixes: skip-plain-regular-comments.diff: just skip plain, regular perl comments... What's the reproducer for the case where this is needed? At least in my trivial testcase, a comment is handled as it should, eg only perl(foo) is provided from package foo; #package bar; support-for-_-in-perl-module-version.diff: support for _ in perl module version This looks fairly obvious, too obvious in fact. Makes me wonder if its being omitted on purpose, but I've not a perl person and haven't got a clue about perl conventions. Ville (or others), thoughts? I'll let Jerome explain. As a side note, another improvement would be to ignore use/require in evals. That would saves quite a lot requires excludes but of course it might not be trivial... ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
[Rpm-maint] [PATCH] perl.{prov,req} improvments
Hi Mageia just switched to internal deps generator (at least). In the process, I unforked as most scripts as possible. Here's some old fixes: skip-plain-regular-comments.diff: just skip plain, regular perl comments... support-for-_-in-perl-module-version.diff: support for _ in perl module version commit 2af13ef2dccbe7c3dc88b4f2b5a5329f0e135a99 Author: Jérôme Quelin jque...@mandriva.org Date: Fri Mar 12 17:22:23 2010 + skip plain, regular comments. how comes this has not been spotted earlier? (sigh) diff --git a/scripts/perl.prov b/scripts/perl.prov index 8f5d53b..3113cb2 100755 --- a/scripts/perl.prov +++ b/scripts/perl.prov @@ -117,7 +117,7 @@ sub process_file { $inover = 0; } -if ($incomment || $inover) { +if ($incomment || $inover || m/^\s*#/) { next; } commit 0f1dd7bebbea6916dc5d698099a8a4cbfb829e81 Author: Jerome Quelin jque...@mageia.org Date: Sat Feb 26 12:04:53 2011 + 1.118 - support for _ in perl module version diff --git a/scripts/perl.prov b/scripts/perl.prov index a6d68bb..85b8e81 100755 --- a/scripts/perl.prov +++ b/scripts/perl.prov @@ -171,7 +171,7 @@ sub process_file { if (m/\$Revision: (\d+[.0-9]+)/) { $version = $1; - } elsif (m/[']?(\d+[.0-9]+)[']?/) { + } elsif (m/[']?(\d+[._0-9]+)[']?/) { # look for a static number hard coded in the script ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint