diff options
author | Fergal Daly <fergal@esatclear.ie> | 2003-10-06 01:25:29 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-10-06 11:44:33 +0000 |
commit | 3e9ed10aee9762a257f9fbd3063cd2e9c7344cea (patch) | |
tree | 58631d2529bb72d8c0c5b2159fdf187e3666bf08 /Porting/makemeta | |
parent | 59e104686f63e092d9adf15809bead3d2855af57 (diff) | |
download | perl-3e9ed10aee9762a257f9fbd3063cd2e9c7344cea.tar.gz |
Re: The META.yml file in bleadperl
Message-Id: <200310060025.29122.fergal@esatclear.ie>
Plus regeneration of META.yml
p4raw-id: //depot/perl@21407
Diffstat (limited to 'Porting/makemeta')
-rw-r--r-- | Porting/makemeta | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Porting/makemeta b/Porting/makemeta index 9889c8e81a..e1a95adccd 100644 --- a/Porting/makemeta +++ b/Porting/makemeta @@ -1,9 +1,12 @@ -#!/usr/bin/perl -w +#!./perl -w +# this script must be run by the current perl to get perl's version right use strict; use warnings; use lib "Porting"; +use File::Basename qw( dirname ); + my $file = "META.yml"; die "$0: will not override $file, delete it first.\n" if -e $file; @@ -13,7 +16,23 @@ 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 = join '', map { " - $_\n" } sort { lc $a cmp lc $b } @files; +my %dirs; +@dirs{@dirs} = (); + +my $files = join '', map { " - $_\n" } + grep { + my $d = $_; + while(($d = dirname($d)) ne "."){ + last if exists $dirs{$d}; + } + + # if $d is "." it means we tried every parent dir of the file and none + # of them were in the private list + + $d eq "."; + } + sort { lc $a cmp lc $b } @files; + my $dirs = join '', map { " - $_\n" } sort { lc $a cmp lc $b } @dirs; open my $fh, ">$file" or die "Can't open $file: $!"; |