diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-05-27 02:24:02 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-05-27 02:24:02 +0000 |
commit | 8384b96c10cfa14fd41e6f1ec317307837102941 (patch) | |
tree | 37b47e98b959de4da7e0bedb615bc8e00d72e16a | |
parent | 90d04f26bdac5ab733fe41b087b0c1b279122714 (diff) | |
download | perl-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-- | NEWS | 8 | ||||
-rw-r--r-- | URPM.pm | 2 | ||||
-rw-r--r-- | URPM/Resolve.pm | 5 |
3 files changed, 12 insertions, 3 deletions
@@ -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/) @@ -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); } } |