Subject: | Module::Build::PPMMaker has broken PPD name versioning for v5.10+ |
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);
}