Skip Menu |

This queue is for tickets about the PPM-Make CPAN distribution.

Report information
The Basics
Id: 97088
Status: resolved
Priority: 0/
Queue: PPM-Make

People
Owner: Nobody in particular
Requestors: Ralf.Neubauer [...] wido.bv.aok.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: work around for PROVIDE needed
Date: Wed, 9 Jul 2014 14:57:55 +0000
To: "bug-PPM-Make [...] rt.cpan.org" <bug-PPM-Make [...] rt.cpan.org>
From: "Neubauer, Ralf" <ralf.neubauer [...] wido.bv.aok.de>
Hi, the generated PPDs have not PROVIDE entries. This may be caused by Bug #97053, but as I don't know how to fix Bug #97053, I needed a work around to make ppm usable (installing a module by asking for a package). My pragmatic solution is: --- PPM\Make.pm.orig 2012-02-02 14:15:37.000000000 +0100 +++ PPM\Make.pm 2014-07-09 16:22:08.865734500 +0200 @@ -629,6 +629,20 @@ sub print_ppd { my ($self, $d, $fn) = @_; + if (-s 'MANIFEST' && !@{$d->{PROVIDE} || []}) { + use File::Slurp; + for my $pm (map /^lib[\\\/](.*?)\.pm(?:\s.*)?$/ ? ($1) : (), + read_file 'MANIFEST', chomp => 1) { + $pm =~ s/[\\\/]/::/g or $pm .= '::'; + push @{$d->{PROVIDE}}, {NAME => $pm}; + } + } + if (!@{$d->{PROVIDE} || []}) { + my $pm = $d->{TITLE}; + $pm =~ s/-[\d\.]*$//; + $pm =~ s/-/::/g or $pm .= '::'; + push @{$d->{PROVIDE}}, {NAME => $pm}; + } open (my $fh, '>', $fn) or die "Couldn't write to $fn: $!"; my $title = xml_encode($d->{TITLE}); my $abstract = xml_encode($d->{ABSTRACT}); This may not be an elegant solution (and I wouldn't mind a better one), but it works for me. Of course you may not want to use File::Slurp -- I installed it anyway, so I use it. Ralf
On 2014-07-09 07:58:08, Ralf.Neubauer@wido.bv.aok.de wrote: Show quoted text
> + use File::Slurp;
Please don't use File::Slurp; it is very broken.
On Wed Jul 09 23:58:08 2014, Ralf.Neubauer@wido.bv.aok.de wrote: Show quoted text
> Hi, > > the generated PPDs have not PROVIDE entries. This may be caused by Bug > #97053, but as I don't know how to fix Bug #97053, I needed a work > around to make ppm usable (installing a module by asking for a > package).
Thanks for this, either. The following patch is pragmatic enough, but I know it shouldn't work in some cases where, for example, a .pm file is placed in the distribution root. So let me reject it. Still, I'll keep this open until I confirm other fixes (including the one for #97053) solve the issue. Please let me know when you find a distribution PPM::Make can't provide "PROVIDE" entries. The information on the failing distribution would help me a lot. Show quoted text
> My pragmatic solution is: > > --- PPM\Make.pm.orig 2012-02-02 14:15:37.000000000 +0100 > +++ PPM\Make.pm 2014-07-09 16:22:08.865734500 +0200 > @@ -629,6 +629,20 @@ > > sub print_ppd { > my ($self, $d, $fn) = @_; > + if (-s 'MANIFEST' && !@{$d->{PROVIDE} || []}) { > + use File::Slurp; > + for my $pm (map /^lib[\\\/](.*?)\.pm(?:\s.*)?$/ ? ($1) : (), > + read_file 'MANIFEST', chomp => 1) { > + $pm =~ s/[\\\/]/::/g or $pm .= '::'; > + push @{$d->{PROVIDE}}, {NAME => $pm}; > + } > + } > + if (!@{$d->{PROVIDE} || []}) { > + my $pm = $d->{TITLE}; > + $pm =~ s/-[\d\.]*$//; > + $pm =~ s/-/::/g or $pm .= '::'; > + push @{$d->{PROVIDE}}, {NAME => $pm}; > + } > open (my $fh, '>', $fn) or die "Couldn't write to $fn: $!"; > my $title = xml_encode($d->{TITLE}); > my $abstract = xml_encode($d->{ABSTRACT}); > > This may not be an elegant solution (and I wouldn't mind a better > one), but it works for me. Of course you may not want to use > File::Slurp -- I installed it anyway, so I use it. > > Ralf
Subject: RE: [rt.cpan.org #97088] work around for PROVIDE needed
Date: Tue, 19 Aug 2014 14:41:18 +0000
To: "bug-PPM-Make [...] rt.cpan.org" <bug-PPM-Make [...] rt.cpan.org>
From: "Neubauer, Ralf" <ralf.neubauer [...] wido.bv.aok.de>
Hi, Show quoted text
> -----Original Message----- > From: Kenichi Ishigaki via RT [mailto:bug-PPM-Make@rt.cpan.org] > > Still, I'll keep this open until I confirm other fixes (including the one for #97053) solve the issue. Please let me know > when you find a distribution PPM::Make can't provide "PROVIDE" entries. The information on the failing distribution would > help me a lot.
Ok. In the comment to #97053 you state that you want to use the MetaCPAN API, but I suppose that won't fix getting "PROVIDE" entries for locally written packages, that are not CPAN-worthy, but that we want to install in an organized fashion on all of our machines. Am I supposed to setup my own MetaCPAN proxy or some server for that to work? Is it possible to declare the "PROVIDE" entries in the module source itself? Ralf
On Tue Aug 19 23:41:32 2014, Ralf.Neubauer@wido.bv.aok.de wrote: Show quoted text
> Hi, >
> > -----Original Message----- > > From: Kenichi Ishigaki via RT [mailto:bug-PPM-Make@rt.cpan.org] > > > > Still, I'll keep this open until I confirm other fixes (including the > > one for #97053) solve the issue. Please let me know > > when you find a distribution PPM::Make can't provide "PROVIDE" > > entries. The information on the failing distribution would > > help me a lot.
> > Ok. > > In the comment to #97053 you state that you want to use the MetaCPAN > API, but I suppose that won't fix getting "PROVIDE" entries for > locally written packages, that are not CPAN-worthy, but that we want > to install in an organized fashion on all of our machines. Am I > supposed to setup my own MetaCPAN proxy or some server for that to > work? Is it possible to declare the "PROVIDE" entries in the module > source itself? > > Ralf >
PROVIDE is to list what the distribution has. So it can (and probably should) be calculated locally by looking into special files including META.*, *.PL, MANIFEST etc, and there are a few modules for that (most notably Module::Metadata). However, detecting PROVIDE is not always that simple and reliable. That's why Randy decided to use his service, and I'm tempted to use MetaCPAN as an authoritative source. However, as I said above, everything can be calculated locally. You shouldn't need to set up something just for PROVIDE. Thanks for the heads-up!
On Wed Aug 20 15:36:36 2014, ISHIGAKI wrote: Show quoted text
> On Tue Aug 19 23:41:32 2014, Ralf.Neubauer@wido.bv.aok.de wrote:
> > Hi, > >
> > > -----Original Message----- > > > From: Kenichi Ishigaki via RT [mailto:bug-PPM-Make@rt.cpan.org] > > > > > > Still, I'll keep this open until I confirm other fixes (including > > > the > > > one for #97053) solve the issue. Please let me know > > > when you find a distribution PPM::Make can't provide "PROVIDE" > > > entries. The information on the failing distribution would > > > help me a lot.
> > > > Ok. > > > > In the comment to #97053 you state that you want to use the MetaCPAN > > API, but I suppose that won't fix getting "PROVIDE" entries for > > locally written packages, that are not CPAN-worthy, but that we want > > to install in an organized fashion on all of our machines. Am I > > supposed to setup my own MetaCPAN proxy or some server for that to > > work? Is it possible to declare the "PROVIDE" entries in the module > > source itself? > > > > Ralf > >
> > PROVIDE is to list what the distribution has. So it can (and probably > should) be calculated locally by looking into special files including > META.*, *.PL, MANIFEST etc, and there are a few modules for that (most > notably Module::Metadata). However, detecting PROVIDE is not always > that simple and reliable. That's why Randy decided to use his service, > and I'm tempted to use MetaCPAN as an authoritative source. > > However, as I said above, everything can be calculated locally. You > shouldn't need to set up something just for PROVIDE. > > Thanks for the heads-up!
Sorry for the long delay. Shipped 0.9904 with a fix to use Parse::LocalDistribution (that is derived from PAUSE) to detect provides. Hope this helps.