We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If MYMETA.yml / .json have an optional_features section, it should probably be also converted and saved in the produced cpanfile.
MYMETA.yml
.json
optional_features
cpanfile
I wrote the following hacky code which seems to work so far:
my $meta = CPAN::Meta->load_file('MYMETA.json'); my $file = Module::CPANfile->from_prereqs($meta->prereqs); for my $feature ($meta->features) { $file->{_prereqs}->add_feature($feature->identifier, $feature->description); my $prereqs = []; while (my ($phase, $types) = each %{$feature->{prereqs}->{prereqs}}) { while (my ($type, $requirements) = each %$types) { my $req_spec = $requirements->as_string_hash; while (my ($module, $version) = each %{$req_spec}) { push @{$prereqs}, Module::CPANfile::Prereq->new( feature => $feature->identifier, phase => $phase, type => $type, module => $module, requirement => Module::CPANfile::Requirement->new( name => $module, version => $version, ), ); } } } $file->{_prereqs}->{prereqs}{$feature->identifier} = $prereqs; } $file->save('cpanfile');
Related: #52
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If
MYMETA.yml
/.json
have anoptional_features
section, it should probably be also converted and saved in the producedcpanfile
.I wrote the following hacky code which seems to work so far:
Related: #52
The text was updated successfully, but these errors were encountered: