From: David Mitchell Date: Sun, 17 May 2009 00:31:56 +0000 (+0100) Subject: update Porting/corecpan.pl to handle new ext/ structure better X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f6e59a58ce5f29ee30bbfb2cb10fc14905407320;p=p5sagit%2Fp5-mst-13.2.git update Porting/corecpan.pl to handle new ext/ structure better (better filename -> module name conversion results in less failed CPAN version lookups) --- diff --git a/Porting/corecpan.pl b/Porting/corecpan.pl index d035bcd..f57899f 100644 --- a/Porting/corecpan.pl +++ b/Porting/corecpan.pl @@ -89,11 +89,13 @@ foreach my $source (@sources) { # some heuristics to figure out the module name from the file name $module =~ s{^(lib|ext)/}{} and $1 eq 'ext' - and ( $module =~ s{^(.*)/lib/\1\b}{$1}, - $module =~ s{(\w+)/\1\b}{$1}, - $module =~ s{^Encode/encoding}{encoding}, - $module =~ s{^MIME/Base64/QuotedPrint}{MIME/QuotedPrint}, - $module =~ s{^List/Util/lib/Scalar}{Scalar}, + and ( + # ext/Foo-Bar/Bar.pm + $module =~ s{^(\w+)-(\w+)/\2$}{$1/lib/$1/$2}, + # ext/Encode/Foo/Foo.pm + $module =~ s{^(Encode)/(\w+)/\2$}{$1/lib/$1/$2}, + $module =~ s{^[^/]+/}{}, + $module =~ s{^lib/}{}, ); $module =~ s{/}{::}g; my $vcpan = $cpanversions{$module} // 'undef';