Be sure to use the correct type, so bits do not get wrapped
[p5sagit/p5-mst-13.2.git] / Porting / Maintainers.pm
index ce773ea..0a2f4c6 100644 (file)
@@ -7,15 +7,19 @@ package Maintainers;
 use strict;
 
 use lib "Porting";
+# Please don't use post 5.008 features as this module is used by
+# Porting/makemeta, and that in turn has to be run by the perl just built.
+use 5.008;
 
 require "Maintainers.pl";
 use vars qw(%Modules %Maintainers);
 
-use vars qw(@ISA @EXPORT_OK);
+use vars qw(@ISA @EXPORT_OK $VERSION);
 @ISA = qw(Exporter);
 @EXPORT_OK = qw(%Modules %Maintainers
                get_module_files get_module_pat
                show_results process_options);
+$VERSION = 0.02;
 require Exporter;
 
 use File::Find;
@@ -104,9 +108,12 @@ sub process_options {
     my @Files;
    
     if ($Opened) {
-       my @raw = `p4 opened`;
+       @Files = `p4 opened`;
        die if $?;
-       @Files =  map {s!#.*!!s; s!^//depot/.*?/perl/!!; $_} @raw;
+       foreach (@Files) {
+           s!#.*!!s;
+           s!^//depot/(?:perl|.*?/perl)/!!;
+       }
     } else {
        @Files = @ARGV;
     }
@@ -248,7 +255,6 @@ sub show_results {
     }
 }
 
-sub warn_maintainer(_);
 my %files;
 
 sub maintainers_files {
@@ -269,19 +275,21 @@ sub duplicated_maintainers {
     }
 }
 
+sub warn_maintainer {
+    my $name = shift;
+    warn "File $name has no maintainer\n" if not $files{$name};
+}
+
 sub missing_maintainers {
     my($check, @path) = @_;
     maintainers_files();
     my @dir;
-    for (@path) { if( -d ) { push @dir, $_ } else { warn_maintainer() } }
+    for my $d (@path) {
+       if( -d $d ) { push @dir, $d } else { warn_maintainer($d) }
+    }
     find sub { warn_maintainer($File::Find::name) if /$check/; }, @dir
        if @dir;
 }
 
-sub warn_maintainer(_) {
-    my $name = shift;
-    warn "File $name has no maintainer\n" if not $files{$name};
-}
-
 1;