From: David Mitchell Date: Sun, 17 May 2009 00:41:06 +0000 (+0100) Subject: make Porting/corecpan.pl handle versions hidden in *_pm.PL files X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=19e87f221220123fd05380fca766d035586f60bf;p=p5sagit%2Fp5-mst-13.2.git make Porting/corecpan.pl handle versions hidden in *_pm.PL files (ie scripts that generate .pm files) --- diff --git a/Porting/corecpan.pl b/Porting/corecpan.pl index f57899f..6fced80 100644 --- a/Porting/corecpan.pl +++ b/Porting/corecpan.pl @@ -81,10 +81,14 @@ foreach my $source (@sources) { for my $dist (sort keys %Modules) { next unless $Modules{$dist}{CPAN}; for my $file (get_module_files($dist)) { - next if $file !~ /\.pm\z/ or $file =~ m{^t/} or $file =~ m{/t/}; + next if $file !~ /(\.pm|_pm.PL)\z/ + or $file =~ m{^t/} or $file =~ m{/t/}; my $vcore = '!EXIST'; $vcore = MM->parse_version($file) // 'undef' if -f $file; + + # get module name from filename to lookup CPAN version my $module = $file; + $module =~ s/\_pm.PL\z//; $module =~ s/\.pm\z//; # some heuristics to figure out the module name from the file name $module =~ s{^(lib|ext)/}{}