From: Nicholas Clark Date: Thu, 30 Jul 2009 20:41:14 +0000 (+0100) Subject: Try longst prefixes first, else lib/CPAN may match lib/CPANPLUS/... and similar. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8cf77941f2751a20a52ac4bbbcff354f82ac4c91;p=p5sagit%2Fp5-mst-13.2.git Try longst prefixes first, else lib/CPAN may match lib/CPANPLUS/... and similar. --- diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm index 5cc9ebd..e5dde3c 100644 --- a/Porting/Maintainers.pm +++ b/Porting/Maintainers.pm @@ -220,13 +220,19 @@ sub files_to_modules { if (@ToDo) { # Try prefix matching. + # Need to try longst prefixes first, else lib/CPAN may match + # lib/CPANPLUS/... and similar + + my @OrderedModuleByPat + = sort {length $b <=> length $a} keys %ModuleByPat; + # Remove trailing slashes. for (@ToDo) { s|/$|| } my %ToDo; @ToDo{@ToDo} = (); - for my $pat (keys %ModuleByPat) { + for my $pat (@OrderedModuleByPat) { last unless keys %ToDo; if (-d $pat) { my @Done;