diff options
author | Thierry Vignaud <tv@mageia.org> | 2011-09-20 18:40:05 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2011-09-20 18:40:05 +0000 |
commit | c52ba6771165a6de3457734aecd0854b809a9ba3 (patch) | |
tree | f4a7f449790d553bdc7cfd798b7b4d8f5632f7aa /URPM/Resolve.pm | |
parent | bd125b38444ceee2b4ee6ff421c743f78faf808a (diff) | |
download | perl-URPM-c52ba6771165a6de3457734aecd0854b809a9ba3.tar perl-URPM-c52ba6771165a6de3457734aecd0854b809a9ba3.tar.gz perl-URPM-c52ba6771165a6de3457734aecd0854b809a9ba3.tar.bz2 perl-URPM-c52ba6771165a6de3457734aecd0854b809a9ba3.tar.xz perl-URPM-c52ba6771165a6de3457734aecd0854b809a9ba3.zip |
(compute_flags) fix slow matching of individual regexes for skipping
dependencies by creating a large regex to match them all at once
(mdv#61389, Shlomi Fish)
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r-- | URPM/Resolve.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index ecc7359..c93c914 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -1617,9 +1617,11 @@ sub compute_flags { #- now search packages which fullname match given regexps if (@regex) { - #- very costly :-( + my $large_re_s = join("|", map { "(?:$_)" } @regex); + my $re = qr/$large_re_s/; + foreach my $pkg (@{$urpm->{depslist}}) { - if (grep { $pkg->fullname =~ /$_/ } @regex) { + if ($pkg->fullname =~ $re){ compute_flag($urpm, $pkg, %options); } } |