Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
perlpunk committed Jul 22, 2024
1 parent 1ca8ab6 commit 17e2514
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions cpanspec
Original file line number Diff line number Diff line change
Expand Up @@ -747,13 +747,24 @@ sub next_version {
return $normal;
}

my $in_core = 0;
my $core540 = $Module::CoreList::version{'5.040000'};
if ($type eq 'dist') {
my $guess_module = $module =~ s/-/::/gr;
# e.g. Module::CoreList is a dual life module with its own package
# in devel:languages:perl
if (exists $core540->{ $guess_module }) {
$in_core = $core540->{ $guess_module };
}
}
if (exists $core540->{ $module }) {
$in_core = $core540->{ $module };
}
if ($in_core) {
# Core perl modules are a bit more complicated, as the perl version
# in Leap is still at 5.26, so requiring 'CPAN > 2.360' would fail.
my $core = $core540->{ $module };
verbose "$module in core 5.40 ($core), keep format: '$next'";
my ($dec_core) = $core =~ m/^\d+\.(\d+)$/;
verbose "$module in core 5.40 ($in_core), keep format: '$next'";
my ($dec_core) = $in_core =~ m/^\d+\.(\d+)$/;
my ($dec) = $next =~ m/^\d+\.(\d+)$/;
if (length $dec > length $dec_core) {
$next = sprintf "%.*f", (length $dec_core), $next;
Expand Down

0 comments on commit 17e2514

Please sign in to comment.