Skip Menu |
 

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 43861
Status: resolved
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: RIVY [...] cpan.org
Cc:
AdminCc:

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

Attachments


Subject: Module::Build::PPMMaker has broken PPD name versioning for v5.10+
Download (untitled) / with headers
text/plain 641b
The new version scheme in 5.10 breaks the version calculation in Module::Build::PPMMaker::_varchname() [which was copied from PPM]. This has been fixed in the most recent version of PPM (per RKOBES)[1]. I've included a revised my_varchname() (and ACTION_ppd) that can be used in a custom Build.PL to work-around the bug until the fix is incorporated into the Module::Build code line. Unfortunately, the attached code does add a dependency on Sub::Override to override the Module::Build::PPMMaker::_varchname subroutine. My attempts to override it directly keep causing exceptions. - Roy [1] http://rt.cpan.org/Ticket/Display.html?id=34084
Subject: ACTION_ppd + my_varchname().txt
##BUGBYPASS: [for Module::Build v0.3 and perl v5.10+ $^V version string change] repairs incorrect version interpretation for perl v5.10+ (still works for 5.8 and earlier, as well) sub my_varchname { # Copied from PPMMaker.pm my ($self, $config) = @_; my $varchname = $config->{archname}; # Append "-5.8" to architecture name for Perl 5.8 and later #if (defined($^V) && ord(substr($^V,1)) >= 8) { #$varchname .= sprintf("-%d.%d", ord($^V), ord(substr($^V,1))); #} ## BUGFIX: send to Module::Build::PPMMaker and PPM if (defined($^V)) { my @v = split(/\./, sprintf(qq{%vd},$^V)); if ($v[1] >= 8) { $varchname .= '-'.$v[0].'.'.$v[1]; } } return $varchname; } # copied from Mobule::Build - Base.pm (v0.3) sub ACTION_ppd { my ($self) = @_; require Module::Build::PPMMaker; my $ppd = Module::Build::PPMMaker->new(); use Sub::Override; my $codeRef = \&my_varchname; my $override = Sub::Override->new( 'Module::Build::PPMMaker::_varchname' => $codeRef ); my $file = $ppd->make_ppd(%{$self->{args}}, build => $self); $self->add_to_cleanup($file); }
Download (untitled) / with headers
text/plain 312b
Show quoted text
> Unfortunately, the attached code does add a dependency on Sub::Override > to override the Module::Build::PPMMaker::_varchname subroutine. My > attempts to override it directly keep causing exceptions.
New code version removing Sub::Override dependency (and seems to be working nonetheless) is attached. - Roy
##BUGBYPASS: [for Module::Build v0.3 and perl v5.10+] repairs incorrect version interpretation for perl v5.10+ sub my_varchname { # Copied from PPMMaker.pm my ($self, $config) = @_; my $varchname = $config->{archname}; # Append "-5.8" to architecture name for Perl 5.8 and later if (defined($^V)) { my @v = split(/\./, sprintf(qq{%vd},$^V)); if ($v[1] >= 8) { $varchname .= '-'.$v[0].'.'.$v[1]; } } return $varchname; } # copied from Mobule::Build - Base.pm (v0.3) sub ACTION_ppd { my ($self) = @_; require Module::Build::PPMMaker; my $ppd = Module::Build::PPMMaker->new(); my $codeRef = \&my_varchname; {no warnings 'redefine'; *Module::Build::PPMMaker::_varchname = $codeRef; } my $file = $ppd->make_ppd(%{$self->{args}}, build => $self); $self->add_to_cleanup($file); }
Download (untitled) / with headers
text/plain 213b
To maintain consistency with PPM.pm, I used the following code instead: if ($] >= 5.008) { my $vstring = sprintf "%vd", $^V; $vstring =~ s/\.\d+$//; $varchname .= "-$vstring"; } Patched in SVN trunk.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.