summaryrefslogtreecommitdiff
path: root/Porting/Maintainers.pm
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2009-05-17 21:06:38 +0100
committerDavid Mitchell <davem@iabyn.com>2009-05-17 21:06:38 +0100
commitadcdf46b836a1f889349164fe4351aece263dc1b (patch)
treee573907e499cc508db46b51d63a49f07f42010cf /Porting/Maintainers.pm
parentbfca551dce91bcb5e8e2595f9262614ca1bd4e7e (diff)
downloadperl-adcdf46b836a1f889349164fe4351aece263dc1b.tar.gz
add _PERLLIB pseudo-module to Maintainers.pl and update Maintainers.pm
to allow !foo* in the file lists to represent a lits of files to be exluded
Diffstat (limited to 'Porting/Maintainers.pm')
-rw-r--r--Porting/Maintainers.pm51
1 files changed, 35 insertions, 16 deletions
diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm
index aa6ef9efab..ee1c7cd6d6 100644
--- a/Porting/Maintainers.pm
+++ b/Porting/Maintainers.pm
@@ -55,26 +55,45 @@ sub get_module_pat {
split ' ', $Modules{$m}{FILES};
}
+# exand dir/ or foo* into a full list of files
+#
+sub expand_glob {
+ sort { lc $a cmp lc $b }
+ map {
+ -f $_ ? # File as-is.
+ $_ :
+ -d _ ? # Recurse into directories.
+ do {
+ my @files;
+ find(
+ sub {
+ push @files, $File::Find::name
+ if -f $_ && exists $MANIFEST{$File::Find::name};
+ }, $_);
+ @files;
+ }
+ # The rest are globbable patterns; expand the glob, then
+ # recurively perform directory expansion on any results
+ : expand_glob(grep -e $_,glob($_))
+ } @_;
+}
+
sub get_module_files {
my $m = shift;
- sort { lc $a cmp lc $b }
- map {
- -f $_ ? # Files as-is.
- $_ :
- -d _ ? # Recurse into directories.
- do {
- my @files;
- find(
- sub {
- push @files, $File::Find::name
- if -f $_ && exists $MANIFEST{$File::Find::name};
- }, $_);
- @files;
- }
- : glob($_) # The rest are globbable patterns.
- } get_module_pat($m);
+ my %exclude;
+ my @files;
+ for (get_module_pat($m)) {
+ if (s/^!//) {
+ $exclude{$_}=1 for expand_glob($_);
+ }
+ else {
+ push @files, expand_glob($_);
+ }
+ }
+ return grep !$exclude{$_}, @files;
}
+
sub get_maintainer_modules {
my $m = shift;
sort { lc $a cmp lc $b }