This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade Data::Dumper to 2.128
[perl5.git] / Porting / makemeta
index bfcc572..b138ea0 100644 (file)
@@ -1,5 +1,8 @@
 #!./perl -w
 # this script must be run by the current perl to get perl's version right
+#
+# Create a META.yml file in the current directory. Must be run from the
+# root directory of a perl source tree.
 
 use strict;
 use warnings;
@@ -7,14 +10,23 @@ use lib "Porting";
 
 use File::Basename qw( dirname );
 
+
+BEGIN {
+    # Get function prototypes
+    require 'regen_lib.pl';
+}
+
+
 my $file = "META.yml";
-die "$0: will not override $file, delete it first.\n" if -e $file;
+my $new_file = "META.yml-new";
 
 use Maintainers qw(%Modules get_module_files get_module_pat);
 
 my @CPAN  = grep { $Modules{$_}{CPAN} } keys %Modules;
-my @files = map { get_module_files($_) } @CPAN;
-my @dirs  = grep { -d $_ } map { get_module_pat($_) } @CPAN;
+my @files = ('lib/unicore/mktables', 'TestInit.pm',
+            'Porting/Maintainers.pm', 'Porting/perldelta_template.pod',
+            map { get_module_files($_) } @CPAN);
+my @dirs  = ('cpan', 'win32', grep { -d $_ && $_  !~ /^cpan/ } map { get_module_pat($_) } @CPAN);
 
 my %dirs;
 @dirs{@dirs} = ();
@@ -35,7 +47,7 @@ my $files = join '', map { "    - $_\n" }
 
 my $dirs  = join '', map { "    - $_\n" } sort { lc $a cmp lc $b } @dirs;
 
-open my $fh, ">$file" or die "Can't open $file: $!";
+my $fh = safer_open($new_file);
 
 print $fh <<"EOI";
 name: perl
@@ -43,13 +55,20 @@ version: $]
 abstract: Practical Extraction and Report Language
 author: perl5-porters\@perl.org
 license: perl
+resources:
+  homepage: http://www.perl.org/
+  bugtracker: http://rt.perl.org/perlbug/
+  license: http://dev.perl.org/licenses/
+  repository: http://perl5.git.perl.org/
 distribution_type: core
-private:
+generated_by: $0
+no_index:
   directory:
 $dirs
   file:
 $files
 EOI
 
-close $fh;
+safer_close($fh);
+rename_if_different($new_file, $file);