Skip Menu |

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

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

Owner: Nobody in particular
Requestors: chris+rt [...]

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

Subject: [PATCH] Using subclass() from a MB subclass
Download (untitled) / with headers
text/plain 1021b
[NOTE: This bug is actually against 0.2610, but doesn't know about that version yet, so I filed against 0.2609. I also checked 0.27_01] I have a Module::Build subclass that handles building Flash projects, called Module::Build::Flash (not yet released). One of my Flash projects needs special treatment, so my Build.PL uses subclass() like so: use Module::Build::Flash; my $class = Module::Build::Flash->subclass( code => <<'EOC' ); ... some method overriding here ... EOC $class->new(dist_name => 'Foo', dist_version => '1.00', )->create_build_script; This fails because the subclass that is created in _build/lib/ has "Module::Build" hard coded in it instead of "Module::Build::Flash". So, the Flash-specific functionality is lost in the subclass() output. The tiny attached patch permits Module::Build subclasses to use the subclass() method by un-hardcoding the reference to Module::Build. The patch is against 0.2610 but should work fine against 0.27_01.
--- 2005-04-19 14:17:04.000000000 -0500 +++ 2005-04-19 14:17:34.000000000 -0500 @@ -509,8 +509,8 @@ my $fh = IO::File->new("> $filename") or die "Can't create $filename: $!"; print $fh <<EOF; package $opts{class}; -use Module::Build; -\@ISA = qw(Module::Build); +use $pack; +\@ISA = qw($pack); $opts{code} 1; EOF
Thanks Chris, I've applied this to the mainline (0.27_xx). -Ken

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

Please report any issues with to