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