use strict;
use warnings;
+use Getopt::Std;
+
+# avoid unnecessary churn in x_serialization_backend in META.*
+$ENV{PERL_JSON_BACKEND} = $ENV{CPAN_META_JSON_BACKEND} = 'JSON::PP';
+$ENV{PERL_YAML_BACKEND} = 'CPAN::Meta::YAML';
my $opts = {
'META.yml' => { version => '1.4' },
'META.json' => { version => '2' },
};
-my $file = shift;
-die "Must specify META.yml or META.json" unless $file and defined $opts->{$file};
+my %switches;
+getopts('byj', \%switches);
+
+my @metafiles;
+if ( $switches{y} ) {
+ push @metafiles, 'META.yml';
+}
+elsif ( $switches{j} ) {
+ push @metafiles, 'META.json';
+}
+else {
+ push @metafiles, keys %$opts;
+}
my ($vers, $stat ) = _determine_status();
'dynamic_config' => 1,
'resources' => {
'repository' => {
- 'url' => 'http://perl5.git.perl.org/'
+ 'url' => 'https://github.com/Perl/perl5'
},
- 'homepage' => 'http://www.perl.org/',
+ 'homepage' => 'https://www.perl.org/',
'bugtracker' => {
- 'web' => 'http://rt.perl.org/perlbug/'
+ 'web' => 'https://github.com/Perl/perl5/issues'
},
'license' => [
- 'http://dev.perl.org/licenses/'
+ 'https://dev.perl.org/licenses/'
],
},
};
BEGIN {
# Get function prototypes
- require 'regen/regen_lib.pl';
+ require './regen/regen_lib.pl';
}
use Maintainers qw(%Modules get_module_files get_module_pat);
my @files = ('autodoc.pl', 'lib/unicore/mktables', 'TestInit.pm',
'Porting/Maintainers.pm', 'Porting/perldelta_template.pod',
map { get_module_files($_) } @CPAN);
-my @dirs = ('cpan', 'win32', 'mad', grep { -d $_ && $_ !~ /^cpan/ } map { get_module_pat($_) } @CPAN);
+my @dirs = ('cpan', 'win32', 'lib/perl5db', grep { -d $_ && $_ !~ /^cpan/ } map { get_module_pat($_) } @CPAN);
my %dirs;
@dirs{@dirs} = ();
$distmeta->{no_index}->{directory} = \@dirs;
my $meta = CPAN::Meta->create( $distmeta );
-my $fh = open_new($file);
-print $fh $meta->as_string( $opts->{$file} );
-close_and_rename($fh);
+foreach my $file ( @metafiles ) {
+ my $fh = open_new($file);
+ print $fh $meta->as_string( $opts->{$file} );
+ close_and_rename($fh);
+}
exit 0;
sub _determine_status {