On Sat, Dec 01, 2007 at 10:29:22AM -0600, Jonathan Rockway wrote:
> 
> On Sat, 2007-12-01 at 06:51 -0800, Bill Moseley wrote:
> > Any ideas on how to add a "make test-exclude-recommends" to Makefile.PL to
> > make that easier?
> 
> Add something like this to Makefile.PL
> 
>   my @RECOMMENDS = qw/.../
>   requires $_ for @RECOMMENDS; # or whatever
> 
>   sub MY::postamble {
>     my $optional = join ',', @RECOMMENDS;
>     return <<"EOM";
> 
> test-exclude-recommends:
> \tperl -MDevel::Hide=-from:children,$optional 'exec("make test")'
> EOM
> 
>   }
> 
> Untested.

Sweet.  Just needs "-e":

my %recommended = (

    'DateTime'                    => '0.34',
    'Date::Manip'                 => '5.44',
    'DateTime::Format::DateManip' => '0.04',
    'Email::Valid'                => '0.179',
    'Template'                    => '2.19',
    'HTML::Tidy'                  => '1.06',
    'File::Temp'                  => '0.16',
    'Net::CIDR'                   => '0.11',
    'Digest::MD5'                 => '2.36',
);

recommends $_ => $recommended{$_} for keys %recommended;

sub MY::postamble {
    my $optional = join ',', keys %recommended;
    return <<"EOM";

test-exclude-recommends:
\tperl -MDevel::Hide=-from:children,$optional -e 'exec("make test")'
EOM

}


Not sure Module::Install does anything with those recommended modules,
though. ;)



-- 
Bill Moseley
[EMAIL PROTECTED]

Reply via email to