summaryrefslogtreecommitdiff
path: root/Porting/corecpan.pl
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2009-05-17 01:31:56 +0100
committerDavid Mitchell <davem@iabyn.com>2009-05-17 01:43:21 +0100
commitf6e59a58ce5f29ee30bbfb2cb10fc14905407320 (patch)
treee7338b0320a6c6b00f5df7abccd0d508825522b6 /Porting/corecpan.pl
parentf7f403a29da80c2644c748df69c5d25710be49ef (diff)
downloadperl-f6e59a58ce5f29ee30bbfb2cb10fc14905407320.tar.gz
update Porting/corecpan.pl to handle new ext/ structure better
(better filename -> module name conversion results in less failed CPAN version lookups)
Diffstat (limited to 'Porting/corecpan.pl')
-rw-r--r--Porting/corecpan.pl12
1 files changed, 7 insertions, 5 deletions
diff --git a/Porting/corecpan.pl b/Porting/corecpan.pl
index d035bcd3b6..f57899fb73 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';