This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make Porting/Maintainers honour EXCLUDED
authorFlorian Ragwitz <rafl@debian.org>
Fri, 25 Mar 2011 15:30:58 +0000 (16:30 +0100)
committerFlorian Ragwitz <rafl@debian.org>
Fri, 25 Mar 2011 15:45:37 +0000 (16:45 +0100)
Porting/Maintainers.pm

index d44bb95..7969af7 100644 (file)
@@ -22,7 +22,7 @@ use vars qw(@ISA @EXPORT_OK $VERSION);
                show_results process_options files_to_modules
         finish_tap_output
                reload_manifest);
-$VERSION = 0.04;
+$VERSION = 0.05;
 
 require Exporter;
 
@@ -87,9 +87,22 @@ sub expand_glob {
            } @_;
 }
 
+sub filter_excluded {
+    my ($m, @files) = @_;
+
+    return @files
+       unless my $excluded = $Modules{$m}{EXCLUDED};
+
+    my ($pat) = map { qr/$_/ } join '|' => map {
+       ref $_ ? qr/\Q$_\E/ : $_
+    } @{ $excluded };
+
+    return grep { $_ !~ $pat } @files;
+}
+
 sub get_module_files {
     my $m = shift;
-    return map { expand_glob($_) } get_module_pat($m);
+    return filter_excluded $m => map { expand_glob($_) } get_module_pat($m);
 }