This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
check for PA* in both branches of case
[perl5.git] / Porting / makemeta
index e0e1ef7..90ce9bf 100644 (file)
@@ -18,12 +18,11 @@ BEGIN {
 
 
 my $file = "META.yml";
-my $new_file = "META.yml-new";
 
 use Maintainers qw(%Modules get_module_files get_module_pat);
 
 my @CPAN  = grep { $Modules{$_}{CPAN} } keys %Modules;
-my @files = ('lib/unicore/mktables', 'TestInit.pm',
+my @files = ('autodoc.pl', 'lib/unicore/mktables', 'TestInit.pm',
             'Porting/Maintainers.pm', 'Porting/perldelta_template.pod',
             map { get_module_files($_) } @CPAN);
 my @dirs  = ('cpan', 'win32', grep { -d $_ && $_  !~ /^cpan/ } map { get_module_pat($_) } @CPAN);
@@ -34,20 +33,23 @@ my %dirs;
 @files = map { "    - $_" }
   grep {
     my $d = $_;
+    my $previous_d = '';
     while(($d = dirname($d)) ne "."){
+      last if $d eq $previous_d; # safety valve
       last if exists $dirs{$d};
+      $previous_d = $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 "."
+    $d eq "." || $d eq $previous_d;
   }
   sort { lc $a cmp lc $b } @files;
 
 @dirs  = map { "    - $_" } sort { lc $a cmp lc $b } @dirs;
 
-my $fh = safer_open($new_file);
+my $fh = open_new($file);
 
 local $" = "\n";
 print $fh <<"EOI";
@@ -70,5 +72,4 @@ no_index:
 @files
 EOI
 
-safer_close($fh);
-rename_if_different($new_file, $file);
+close_and_rename($fh);