Evil EU::MM hackery required

Andy Armstrong andy at hexten.net
Tue Mar 4 15:54:40 GMT 2008


On 4 Mar 2008, at 15:05, David Cantrell wrote:
> So I need to hook into make dist to shim some of my code in to read
> and then write a new META.yml between EU::MM creating it and the
> tarball being created.  Buggered if I can figure out how though.  Help
> please!


This works for EUMM:

package MY;

sub metafile {
     my @lines = split /\n/, shift->SUPER::metafile_target( @_ );

     my @exclude = qw( Devel::CheckOS );
     my $pad     = ' ' x 4;
     my $tail    = pop @lines;
     if ( $lines[-1] =~ /^([^']*').*?('[^']*)$/ ) {
         my ( $pre, $post ) = ( $1, $2 );
         push @lines, map { "${pre}$_${post}" } (
             'no_index:', "${pad}package:",
             map { "${pad}${pad}- $_" } @exclude
         );
     } else {
         die "Can't parse Makefile fragment";
     }
     push @lines, $tail;

     return join "\n", @lines;
}

-- 
Andy Armstrong, Hexten






More information about the london.pm mailing list