This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Show diagnostic link format in perldelta template
[perl5.git] / Porting / makemeta
CommitLineData
3e9ed10a
FD
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
JH
6
7use strict;
8use warnings;
9use lib "Porting";
10
3e9ed10a
FD
11use File::Basename qw( dirname );
12
df1ad5b3
JV
13
14BEGIN {
15 # Get function prototypes
2bd4012d 16 require 'regen/regen_lib.pl';
df1ad5b3
JV
17}
18
19
0cf51544 20my $file = "META.yml";
0cf51544
JH
21
22use Maintainers qw(%Modules get_module_files get_module_pat);
23
24my @CPAN = grep { $Modules{$_}{CPAN} } keys %Modules;
25c32de1
NC
25my @files = ('lib/unicore/mktables', 'TestInit.pm',
26 'Porting/Maintainers.pm', 'Porting/perldelta_template.pod',
27 map { get_module_files($_) } @CPAN);
28my @dirs = ('cpan', 'win32', grep { -d $_ && $_ !~ /^cpan/ } map { get_module_pat($_) } @CPAN);
0cf51544 29
3e9ed10a
FD
30my %dirs;
31@dirs{@dirs} = ();
32
e34f6d89 33@files = map { " - $_" }
3e9ed10a
FD
34 grep {
35 my $d = $_;
2ccec147 36 my $previous_d = '';
3e9ed10a 37 while(($d = dirname($d)) ne "."){
2ccec147 38 last if $d eq $previous_d; # safety valve
3e9ed10a 39 last if exists $dirs{$d};
2ccec147 40 $previous_d = $d;
3e9ed10a
FD
41 }
42
43 # if $d is "." it means we tried every parent dir of the file and none
44 # of them were in the private list
45
2ccec147 46 $d eq "." || $d eq $previous_d;
3e9ed10a
FD
47 }
48 sort { lc $a cmp lc $b } @files;
49
e34f6d89 50@dirs = map { " - $_" } sort { lc $a cmp lc $b } @dirs;
0cf51544 51
29c22b52 52my $fh = open_new($file);
0cf51544 53
e34f6d89 54local $" = "\n";
0cf51544
JH
55print $fh <<"EOI";
56name: perl
57version: $]
095a5c3e 58abstract: The Perl 5 language interpreter
0cf51544
JH
59author: perl5-porters\@perl.org
60license: perl
ec08ff80
NC
61resources:
62 homepage: http://www.perl.org/
63 bugtracker: http://rt.perl.org/perlbug/
64 license: http://dev.perl.org/licenses/
f3560023 65 repository: http://perl5.git.perl.org/
0cf51544 66distribution_type: core
dbcf044e
NC
67generated_by: $0
68no_index:
0cf51544 69 directory:
e34f6d89 70@dirs
0cf51544 71 file:
e34f6d89 72@files
0cf51544
JH
73EOI
74
284e4287 75close_and_rename($fh);