Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 25179
Status: resolved
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: Nobody in particular
Requestors: olivier.boudry [...] gmail.com
Cc:
AdminCc:

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



Subject: make ppd doesn't list prerequisites properly
Prerequisite of my WriteMakefile looks like this: 'PREREQ_PM' => { 'YAML' => 0, 'Test::More' => 0 }, In the generated ppd file 'Test::More' is translated to 'Test-More' (the name a corresponding ppm would be given): <DEPENDENCY NAME="Test-More" VERSION="0,0,0,0" /> Building the ppd works fine but installing the ppm gives me the following error: ppm install failed: Can't find any package that provide Test-More for sapnwrfc I added this to my Makefile.PL to get the build working, but I would prefer the module to work without this: sub MY::ppd { my $self = shift; my $section = $self->MM::ppd; if ($^O =~ /MSWin32/i) { $section =~ s|Test-More|Test::More|m; } return $section; } I also tried to replace the Test::More requirement with a Test::Simple requirement (to match a ppm module name) but on Win32 Test::Simple and Test::More are not intalled as ppm modules but are bundled with the Perl installation. Doing this I get the following warning message: C:\Temp\perl\sapnwrfc-0.06>ppm install sapnwrfc.ppd ppm install failed: Installing Test-Simple-0.47 would downgradeTest::Builder from version 0.32 to 0.17 and Test::More from version 0.62 to 0.47 and Test::Simple from version 0.62 to 0.47; use --force to install regardless Would it be possible to have MakeMaker not transform the '::' into '-' when a module is not installed as a ppm? Cheers, Olivier.
On Tue Feb 27 09:37:51 2007, olivier.boudry@gmail.com wrote: Show quoted text
> Prerequisite of my WriteMakefile looks like this: > > 'PREREQ_PM' => { 'YAML' => 0, 'Test::More' => 0 }, > > In the generated ppd file 'Test::More' is translated to 'Test-More' (the > name a corresponding ppm would be given): > > <DEPENDENCY NAME="Test-More" VERSION="0,0,0,0" /> > > Building the ppd works fine but installing the ppm gives me the > following error: > > ppm install failed: Can't find any package that provide Test-More > for sapnwrfc > > I added this to my Makefile.PL to get the build working, but I would > prefer the module to work without this: > > sub MY::ppd { > > my $self = shift; > my $section = $self->MM::ppd; > if ($^O =~ /MSWin32/i) { > $section =~ s|Test-More|Test::More|m; > } > return $section; > }
The documentation on the format of DEPENDENCY is unclear but implies that it takes a distribution (Test-Simple), what it calls a "Perl Package". All of the examples I can find take distributions and none take module names. It would be nice if DEPENDENCY did take a module name because that would be more accurate. If you find something definitive about this please let me know. Show quoted text
> I also tried to replace the Test::More requirement with a Test::Simple > requirement (to match a ppm module name) but on Win32 Test::Simple and > Test::More are not intalled as ppm modules but are bundled with the Perl > installation. Doing this I get the following warning message: > > C:\Temp\perl\sapnwrfc-0.06>ppm install sapnwrfc.ppd > ppm install failed: Installing Test-Simple-0.47 would > downgradeTest::Builder from version 0.32 to 0.17 and Test::More from > version 0.62 to 0.47 and Test::Simple from version 0.62 to 0.47; use > --force to install regardless > > Would it be possible to have MakeMaker not transform the '::' into '-' > when a module is not installed as a ppm?
Sorry, no. MakeMaker has no idea whether a module is installed as a ppm or not. In fact, it doesn't know anything about ppm (and neither do I) except the ability to output a ppd. This part sounds like a lacking in ppm and you should discuss it with them.
Feb 27 09:37:51 2007, olivier.boudry@gmail.com wrote: Show quoted text
> Prerequisite of my WriteMakefile looks like this: > > 'PREREQ_PM' => { 'YAML' => 0, 'Test::More' => 0 }, > > In the generated ppd file 'Test::More' is translated to 'Test-More' (the > name a corresponding ppm would be given): > > <DEPENDENCY NAME="Test-More" VERSION="0,0,0,0" /> > > Building the ppd works fine but installing the ppm gives me the > following error: > > ppm install failed: Can't find any package that provide Test-More > for sapnwrfc
You need to manually correct all dependencies. I use mod_search from PPM::Make::Util, which in turn uses CPAN.pm, in my own tool for generating distributions. In general look at PPM::Make at CPAN. P.S. I think that new ppd format format from ActiveState solves this problem, but I'm not sure. -- Alexandr Ciornii, http://chorny.net
Since PPM4 we have made PPM in ActivePerl use the <REQUIRE> element instead of <DEPENDENCY> to solve this. Attached is a patch that make 'make ppd' output a new style PPD file. This patch has a dependency on 'version' which might be a problem.
commit 77d1f966820318de3c302a6f5ae6ef7a7a06e58a Author: Gisle Aas <gisle@aas.no> Date: Wed Jul 16 14:58:12 2008 +0200 Generate PPM4 style PPD files. diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 644d99b..5624c47 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -2952,8 +2952,6 @@ for a binary distribution. sub ppd { my($self) = @_; - my ($pack_ver) = join ",", (split (/\./, $self->{VERSION}), (0)x4)[0..3]; - my $abstract = $self->{ABSTRACT} || ''; $abstract =~ s/\n/\\n/sg; $abstract =~ s/</&lt;/g; @@ -2963,23 +2961,25 @@ sub ppd { $author =~ s/</&lt;/g; $author =~ s/>/&gt;/g; - my $ppd_xml = sprintf <<'PPD_HTML', $pack_ver, $abstract, $author; + my $ppd_xml = sprintf <<'PPD_HTML', $self->{VERSION}, $abstract, $author; <SOFTPKG NAME="$(DISTNAME)" VERSION="%s"> - <TITLE>$(DISTNAME)</TITLE> <ABSTRACT>%s</ABSTRACT> <AUTHOR>%s</AUTHOR> PPD_HTML $ppd_xml .= " <IMPLEMENTATION>\n"; foreach my $prereq (sort keys %{$self->{PREREQ_PM}}) { - my $pre_req = $prereq; - $pre_req =~ s/::/-/g; - my ($dep_ver) = join ",", (split (/\./, $self->{PREREQ_PM}{$prereq}), - (0) x 4) [0 .. 3]; - $ppd_xml .= sprintf <<'PPD_OUT', $pre_req, $dep_ver; - <DEPENDENCY NAME="%s" VERSION="%s" /> -PPD_OUT - + my $name = $prereq; + $name .= "::" unless $name =~ /::/; + $ppd_xml .= qq( <REQUIRE NAME="$name"); + if (my $vers = $self->{PREREQ_PM}{$prereq}) { + unless ($vers =~ /^\d+(?:\.\d+)?\z/) { + require version; + $vers = version->new($vers)->numify; + } + $ppd_xml .= qq( VERSION="$vers"); + } + $ppd_xml .= qq( />\n); } my $archname = $Config{archname}; diff --git a/t/basic.t b/t/basic.t index 64352d8..6f24cc0 100644 --- a/t/basic.t +++ b/t/basic.t @@ -17,7 +17,7 @@ use strict; use Config; use ExtUtils::MakeMaker; -use Test::More tests => 83; +use Test::More tests => 82; use MakeMaker::Test::Utils; use MakeMaker::Test::Setup::BFD; use File::Find; @@ -93,17 +93,15 @@ ok( open(PPD, 'Big-Dummy.ppd'), ' .ppd file generated' ); my $ppd_html; { local $/; $ppd_html = <PPD> } close PPD; -like( $ppd_html, qr{^<SOFTPKG NAME="Big-Dummy" VERSION="0,01,0,0">}m, +like( $ppd_html, qr{^<SOFTPKG NAME="Big-Dummy" VERSION="0.01">}m, ' <SOFTPKG>' ); -like( $ppd_html, qr{^\s*<TITLE>Big-Dummy</TITLE>}m, ' <TITLE>' ); like( $ppd_html, qr{^\s*<ABSTRACT>Try "our" hot dog's</ABSTRACT>}m, ' <ABSTRACT>'); like( $ppd_html, qr{^\s*<AUTHOR>Michael G Schwern &lt;schwern\@pobox.com&gt;</AUTHOR>}m, ' <AUTHOR>' ); like( $ppd_html, qr{^\s*<IMPLEMENTATION>}m, ' <IMPLEMENTATION>'); -like( $ppd_html, qr{^\s*<DEPENDENCY NAME="strict" VERSION="0,0,0,0" />}m, - ' <DEPENDENCY>' ); +like( $ppd_html, qr{^\s*<REQUIRE NAME="strict::" />}m, ' <REQUIRE>' ); like( $ppd_html, qr{^\s*<OS NAME="$Config{osname}" />}m, ' <OS>' ); my $archname = $Config{archname};
Thanks, I've committed that. I worked around the version.pm issue by just numifying the $VERSION with a +0. I'll also remove the deprecated OS tag. I've left in PERLCORE because its how MIN_PERL_VERSION is being expressed and there doesn't seem to be any good way around that, but that may be incorrect. While we're on the subject, should MakeMaker be saying <ARCHITECTURE NAME="noarch"/> when there's no XS code?