From 070f1be3d5c3aa813f61d061c2a0fd38c2477c08 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 --- URPM/Resolve.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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