From a31506d8123747d15346f7808e8c14bce91bcd9b Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Sun, 16 Oct 2016 12:43:49 +0200 Subject: mga#15353 don't crash if re is wrong --- NEWS | 2 ++ URPM/Resolve.pm | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 96317f3..d076bfe 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- don't crash if /etc/urpmi/skip.list RE is wrong (mga#15353) + Version 5.06.1 - 14 October 2016 - fix reporting size on big packages (mga#19571) diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 641e006..38781cc 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -1945,14 +1945,17 @@ 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/; + eval { + my $large_re_s = join("|", map { "(?:$_)" } @regex); + my $re = qr/$large_re_s/; - foreach my $pkg (@{$urpm->{depslist}}) { - if ($pkg->fullname =~ $re) { - compute_flag($urpm, $pkg, %options); - } - } + foreach my $pkg (@{$urpm->{depslist}}) { + if ($pkg->fullname =~ $re) { + compute_flag($urpm, $pkg, %options); + } + } + }; + $urpm->{debug_URPM}("reg ex problem: " . $@) if $@; } } -- cgit v1.2.1