Skip to content

Commit 99cd1c8

Browse files
committed
Add prereqs in meta_merge to mymeta
1 parent 6280dda commit 99cd1c8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/Module/Build/Base.pm

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1931,9 +1931,22 @@ sub create_mymeta {
19311931
$mymeta_obj = $meta_obj;
19321932
} else {
19331933
# if we have metadata, just update it
1934+
my $prereqs = $self->_normalize_prereqs;
1935+
if (my $merge = $self->meta_merge) {
1936+
unless ($merge->{'meta-spec'} && ($merge->{'meta-spec'}{version} // '1.4') eq '2') {
1937+
require CPAN::Meta::Converter;
1938+
$merge = CPAN::Meta::Converter->new($merge)->upgrade_fragment;
1939+
}
1940+
if ($merge->{prereqs}) {
1941+
my $left = CPAN::Meta::Prereqs->new($prereqs);
1942+
my $right = CPAN::Meta::Prereqs->new($merge->{prereqs});
1943+
$prereqs = $left->with_merged_prereqs($right)->as_string_hash;
1944+
}
1945+
}
1946+
19341947
my %updated = (
19351948
%{ $meta_obj->as_struct({ version => 2.0 }) },
1936-
prereqs => $self->_normalize_prereqs,
1949+
prereqs => $prereqs,
19371950
dynamic_config => 0,
19381951
generated_by => "Module::Build version $Module::Build::VERSION",
19391952
);

0 commit comments

Comments
 (0)