aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--URPM/Resolve.pm6
2 files changed, 7 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index f8219f9..8e8e62f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- 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.1 - 16 November 2010
- fix crashing while removing several packages (#248)
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index b82b45b..51fda20 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -1616,9 +1616,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);
}
}