aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--URPM/Resolve.pm6
2 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index a1f51a6..20cc27e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
- enable to traverse db by fullname
+- fix slow matching of individual regexes for skipping dependencies by creating
+ a large regex to match them all at once (mdv#61389, Shlomi Fish)
Version 3.38.4 - 17 September 2011
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);
}
}