Skip to content

Commit

Permalink
Merge pull request #1344 from metacpan/haarg/apostrophe-package-latest
Browse files Browse the repository at this point in the history
normalize package names to use ::
  • Loading branch information
haarg authored Feb 1, 2025
2 parents 0f81e20 + a56aa4e commit d1a4eb8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/MetaCPAN/Model/Release.pm
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,15 @@ sub _modules_from_files {

# Ignore packages that people cannot claim.
# https://github.com/andk/pause/blob/master/lib/PAUSE/pmfile.pm#L236
for my $pkg ( grep { $_ ne 'main' && $_ ne 'DB' }
$info->packages_inside )
{
#
# Parse::PMFile and PAUSE translate apostrophes to double colons,
# but Module::Metadata does not.
my @packages
= map s{'}{::}gr,
grep { $_ ne 'main' && $_ ne 'DB' }
$info->packages_inside;

for my $pkg (@packages) {
my $version = $info->version($pkg);
$file->add_module( {
name => $pkg,
Expand Down

0 comments on commit d1a4eb8

Please sign in to comment.