Add a new Porting/podtidy to reformat pod using Pod::Tidy
[p5sagit/p5-mst-13.2.git] / Porting / makemeta
CommitLineData
3e9ed10a 1#!./perl -w
2# this script must be run by the current perl to get perl's version right
0cf51544 3
4use strict;
5use warnings;
6use lib "Porting";
7
3e9ed10a 8use File::Basename qw( dirname );
9
0cf51544 10my $file = "META.yml";
11die "$0: will not override $file, delete it first.\n" if -e $file;
12
13use Maintainers qw(%Modules get_module_files get_module_pat);
14
15my @CPAN = grep { $Modules{$_}{CPAN} } keys %Modules;
16my @files = map { get_module_files($_) } @CPAN;
17my @dirs = grep { -d $_ } map { get_module_pat($_) } @CPAN;
18
3e9ed10a 19my %dirs;
20@dirs{@dirs} = ();
21
22my $files = join '', map { " - $_\n" }
23 grep {
24 my $d = $_;
25 while(($d = dirname($d)) ne "."){
26 last if exists $dirs{$d};
27 }
28
29 # if $d is "." it means we tried every parent dir of the file and none
30 # of them were in the private list
31
32 $d eq ".";
33 }
34 sort { lc $a cmp lc $b } @files;
35
0cf51544 36my $dirs = join '', map { " - $_\n" } sort { lc $a cmp lc $b } @dirs;
37
38open my $fh, ">$file" or die "Can't open $file: $!";
39
40print $fh <<"EOI";
41name: perl
42version: $]
717f132d 43abstract: Practical Extraction and Report Language
0cf51544 44author: perl5-porters\@perl.org
45license: perl
ec08ff80 46resources:
47 homepage: http://www.perl.org/
48 bugtracker: http://rt.perl.org/perlbug/
49 license: http://dev.perl.org/licenses/
0cf51544 50distribution_type: core
dbcf044e 51generated_by: $0
52no_index:
0cf51544 53 directory:
54$dirs
55 file:
56$files
57EOI
58
59close $fh;
60