2 # this script must be run by the current perl to get perl's version right
4 # Create a META.yml file in the current directory. Must be run from the
5 # root directory of a perl source tree.
11 use File::Basename qw( dirname );
15 # Get function prototypes
16 require 'regen_lib.pl';
20 my $file = "META.yml";
21 my $new_file = "META.yml-new";
23 use Maintainers qw(%Modules get_module_files get_module_pat);
25 my @CPAN = grep { $Modules{$_}{CPAN} } keys %Modules;
26 my @files = ('lib/unicore/mktables', 'TestInit.pm',
27 'Porting/Maintainers.pm', 'Porting/perldelta_template.pod',
28 map { get_module_files($_) } @CPAN);
29 my @dirs = ('cpan', 'win32', grep { -d $_ && $_ !~ /^cpan/ } map { get_module_pat($_) } @CPAN);
34 my $files = join '', map { " - $_\n" }
37 while(($d = dirname($d)) ne "."){
38 last if exists $dirs{$d};
41 # if $d is "." it means we tried every parent dir of the file and none
42 # of them were in the private list
46 sort { lc $a cmp lc $b } @files;
48 my $dirs = join '', map { " - $_\n" } sort { lc $a cmp lc $b } @dirs;
50 my $fh = safer_open($new_file);
55 abstract: Practical Extraction and Report Language
56 author: perl5-porters\@perl.org
59 homepage: http://www.perl.org/
60 bugtracker: http://rt.perl.org/perlbug/
61 license: http://dev.perl.org/licenses/
62 repository: http://perl5.git.perl.org/
63 distribution_type: core
73 rename_if_different($new_file, $file);