This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make makemeta more cognisant and easier to use
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Tue, 5 Feb 2013 21:24:34 +0000 (21:24 +0000)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Tue, 5 Feb 2013 21:24:34 +0000 (21:24 +0000)
Provide -y and -j switches to produce yml or json
files, respectively, for use in regen rules and tests

The default behaviour is to produce both files.

Update release managers' guide to say to regen the
META files before generating release tarballs.

Cross/Makefile-cross-SH
Makefile.SH
Porting/makemeta
Porting/release_managers_guide.pod
t/porting/regen.t

index 6a0237c..18c881d 100644 (file)
@@ -772,10 +772,10 @@ extras.install: perl$(EXE_EXT)
        no-install install.perl install.man install.html
 
 META.yml:      Porting/makemeta Porting/Maintainers.pl Porting/Maintainers.pm
-       $(LDLIBPTH) ./miniperl -Ilib Porting/makemeta META.yml
+       $(LDLIBPTH) ./miniperl -Ilib Porting/makemeta -y
 
 META.json:     Porting/makemeta Porting/Maintainers.pl Porting/Maintainers.pm
-       $(LDLIBPTH) ./miniperl -Ilib Porting/makemeta META.json
+       $(LDLIBPTH) ./miniperl -Ilib Porting/makemeta -j
 
 install-strip:
        $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)"
index 3559262..cadfafb 100755 (executable)
@@ -1190,10 +1190,10 @@ regen_headers regen-headers:    FORCE
 regen_meta regen-meta:  META.yml META.json
 
 META.yml:   FORCE
-       PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta META.yml
+       PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta -y
 
 META.json:   FORCE
-       PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta META.json
+       PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta -j
 
 
 regen_all regen-all: regen regen_meta
index 7771ecb..1c7016b 100644 (file)
@@ -6,14 +6,26 @@
 
 use strict;
 use warnings;
+use Getopt::Std;
 
 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();
 
@@ -86,9 +98,11 @@ $distmeta->{no_index}->{file} = \@files;
 $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 {
index 60eabe7..206887d 100644 (file)
@@ -699,6 +699,13 @@ Be sure to commit your change:
 
     $ git commit -m 'bump version to RCnnn' patchlevel.h
 
+=head3 run makemeta to update META files
+
+    $ perl Porting/makemeta
+
+Be sure to commit any changes (if applicable):
+
+    $ git commit -m 'Update META files' META.*
 
 =head3 build, test and check a fresh perl
 
index ec92dd3..e127eb0 100644 (file)
@@ -48,6 +48,6 @@ foreach (@progs, 'regen.pl') {
   system "$^X $_ --tap";
 }
 
-foreach ( 'META.yml', 'META.json' ) {
+foreach ( '-y', '-j' ) {
   system "$^X Porting/makemeta --tap $_";
 }