aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-05-27 02:24:02 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-05-27 02:24:02 +0000
commit8384b96c10cfa14fd41e6f1ec317307837102941 (patch)
tree37b47e98b959de4da7e0bedb615bc8e00d72e16a
parent90d04f26bdac5ab733fe41b087b0c1b279122714 (diff)
downloadperl-URPM-8384b96c10cfa14fd41e6f1ec317307837102941.tar
perl-URPM-8384b96c10cfa14fd41e6f1ec317307837102941.tar.gz
perl-URPM-8384b96c10cfa14fd41e6f1ec317307837102941.tar.bz2
perl-URPM-8384b96c10cfa14fd41e6f1ec317307837102941.tar.xz
perl-URPM-8384b96c10cfa14fd41e6f1ec317307837102941.zip
fix slow matching of individual regexes for skipping dependencies by creating a large regex to match them all at once (#61389, patch contributed by Shlomi Fish \o/)
-rw-r--r--NEWS8
-rw-r--r--URPM.pm2
-rw-r--r--URPM/Resolve.pm5
3 files changed, 12 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index dd8afb1..2df9cea 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,10 @@
-Version 4.30 . 12 May 2011, by Per Øyvind Karlsen
+Version 4.31 - 27 May 2011, by Per Øyvind Karlsen
+
+- fix slow matching of individual regexes for skipping dependencies by creating
+ a large regex to match them all at once (#61389, patch contributed by
+ Shlomi Fish \o/)
+
+Version 4.30 - 12 May 2011, by Per Øyvind Karlsen
- fix Resolve.pm/_choose_required() breakage after DUDF merge, causing ie.
'urpmq -d' to break (#63250, with big thanks to Funda\o/)
diff --git a/URPM.pm b/URPM.pm
index df9efd6..7c28cdd 100644
--- a/URPM.pm
+++ b/URPM.pm
@@ -11,7 +11,7 @@ use URPM::Resolve;
use URPM::Signature;
our @ISA = qw(DynaLoader);
-our $VERSION = '4.30';
+our $VERSION = '4.31';
URPM->bootstrap($VERSION);
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 47de216..e2b38f5 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -1623,9 +1623,12 @@ sub compute_flags {
#- now search packages which fullname match given regexps
if (@regex) {
+ my $large_re_s = join("|", map { "(?:$_)" } @regex);
+ my $re = qr/$large_re_s/;
+
#- very costly :-(
foreach my $pkg (@{$urpm->{depslist}}) {
- if (grep { $pkg->fullname =~ /$_/ } @regex) {
+ if ($pkg->fullname =~ $re){
compute_flag($urpm, $pkg, %options);
}
}