Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
PAR::Dist::parse_dist_name mis-parses par file name when arch is darwin-2level
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
"Ken Olstad via RT"  
View profile  
 More options Jul 4 2012, 1:30 am
Newsgroups: perl.par
From: bug-...@rt.cpan.org ("Ken Olstad via RT")
Date: Wed, 4 Jul 2012 01:30:52 -0400
Local: Wed, Jul 4 2012 1:30 am
Subject: [rt.cpan.org #78194] PAR::Dist::parse_dist_name mis-parses par file name when arch is darwin-2level
Wed Jul 04 01:30:50 2012: Request 78194 was acted upon.
Transaction: Ticket created by KENO
       Queue: PAR
     Subject: PAR::Dist::parse_dist_name mis-parses par file name when arch  is
 darwin-2level
   Broken in: 0.48
    Severity: Important
       Owner: Nobody
  Requestors: k...@cpan.org
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=78194 >

I am unable to load a module with arch=darwin-2level from a PAR::Repository.  When parsing
the par file name, PAR::Dist::parse_dist_name() counts 2level as a Perl version.  The test is to
create a repository containing some module that is not otherwise available on the system.  I
used Acme::Drunk.

$ cat /tmp/testpar.pl
use strict;
use warnings;

use Test::More tests => 1;

BEGIN {
  SKIP: {
        eval{ require Acme::Drunk; 1 }
          and skip 'Acme::Drunk must not be available.';
        eval{ require PAR;
              PAR->import( {
                            repository => 'file:///tmp/repo/',
                            fallback => 0,
                           } );
              1; }
          or skip 'Could not load PAR.';
        use_ok( 'Acme::Drunk' );
    }

}

$ find /tmp/repo -name \*.par
/tmp/repo/darwin-2level/5.16.0/Acme-Drunk-0.03-darwin-2level-5.16.0.par
$ ls -l Dist.pm*
lrwxr-xr-x  1 root  wheel     12 Jul  4 00:20 Dist.pm -> Dist.pm.orig
-r--r--r--  1 root  wheel  43107 Jul  4 00:08 Dist.pm.new
-rw-r--r--  1 root  wheel  43106 Jul  4 00:09 Dist.pm.orig
$ diff Dist.pm.orig Dist.pm.new
1143c1143
<     my $version = qr/v?(?:\d+(?:_\d+)?|\d*(?:\.\d+(?:_\d+)?)+)/;
---
>     my $version = qr/v?(?:\d+(?:_\d+)?|\d*(?:\.\d+(?:_\d+)?)+)$/;

$ perl /tmp/testpar.pl
1..1
not ok 1 - use Acme::Drunk;
#   Failed test 'use Acme::Drunk;'
#   at /tmp/testpar.pl line 17.
#     Tried to use 'Acme::Drunk'.
#     Error:  Can't locate Acme/Drunk.pm in @INC (@INC contains: CODE(0x10088ff00) /usr/
local/lib/perl5/site_perl/5.16.0/darwin-2level /usr/local/lib/perl5/site_perl/5.16.0 /usr/
local/lib/perl5/5.16.0/darwin-2level /usr/local/lib/perl5/5.16.0 . CODE(0x100890008)) at
(eval 42) line 2.
# BEGIN failed--compilation aborted at (eval 42) line 2.
# Looks like you failed 1 test of 1.
$ sudo ln -sf Dist.pm.new Dist.pm
Password:
$ perl /tmp/testpar.pl
1..1
ok 1 - use Acme::Drunk;
$

The first fix that came to mind is shown above: just add '$' to the version regexp.  But maybe
this is too restrictive; I have not tested on other platforms.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Ken Olstad via RT"  
View profile  
 More options Aug 8 2012, 11:45 am
Newsgroups: perl.par
From: bug-...@rt.cpan.org ("Ken Olstad via RT")
Date: Wed, 8 Aug 2012 11:45:15 -0400
Local: Wed, Aug 8 2012 11:45 am
Subject: [rt.cpan.org #78194] PAR::Dist::parse_dist_name mis-parses par file name when arch is darwin-2level
Wed Aug 08 11:45:14 2012: Request 78194 was acted upon.
Transaction: Correspondence added by KENO
       Queue: PAR
     Subject: PAR::Dist::parse_dist_name mis-parses par file name when arch  is darwin-2level
   Broken in: 0.48
    Severity: Important
       Owner: Nobody
  Requestors: k...@cpan.org
      Status: open
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=78194 >

The fix I suggested above does work but it's not the right fix.  The right fix is to change line
1171 from this

        if ($e =~ /^$version|any_version$/) {

to this

        if ($e =~ /^(?:$version|any_version)$/) {

This is the match that was too loose.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Roderich Schupp via RT"  
View profile  
 More options Oct 12 2012, 3:30 am
Newsgroups: perl.par
From: bug-PAR-D...@rt.cpan.org ("Roderich Schupp via RT")
Date: Fri, 12 Oct 2012 03:13:16 -0400
Local: Fri, Oct 12 2012 3:13 am
Subject: [rt.cpan.org #78194] PAR::Dist::parse_dist_name mis-parses par file name when arch is darwin-2level
Fri Oct 12 03:13:16 2012: Request 78194 was acted upon.
Transaction: Correspondence added by RSCHUPP
       Queue: PAR-Dist
     Subject: PAR::Dist::parse_dist_name mis-parses par file name when arch  is darwin-2level
   Broken in: (no value)
    Severity: Important
       Owner: RSCHUPP
  Requestors: k...@cpan.org
      Status: open
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=78194 >

Applied your patch, will be in the next release. Thanks Ken!

Cheers, Roderich


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »