Skip to content

Commit a56aa4e

Browse files
committed
normalize package names to use ::
package names extracted by PAUSE or Parse::PMFile are normalized to use double colons rather than apostrophe. Module::Metadata does not. Add the normalization to the output of Module::Metadata when we index files so that the module names will match what exists in 02packages.
1 parent 2b60e5d commit a56aa4e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/MetaCPAN/Model/Release.pm

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,15 @@ sub _modules_from_files {
545545

546546
# Ignore packages that people cannot claim.
547547
# https://github.com/andk/pause/blob/master/lib/PAUSE/pmfile.pm#L236
548-
for my $pkg ( grep { $_ ne 'main' && $_ ne 'DB' }
549-
$info->packages_inside )
550-
{
548+
#
549+
# Parse::PMFile and PAUSE translate apostrophes to double colons,
550+
# but Module::Metadata does not.
551+
my @packages
552+
= map s{'}{::}gr,
553+
grep { $_ ne 'main' && $_ ne 'DB' }
554+
$info->packages_inside;
555+
556+
for my $pkg (@packages) {
551557
my $version = $info->version($pkg);
552558
$file->add_module( {
553559
name => $pkg,

0 commit comments

Comments
 (0)