aboutsummaryrefslogtreecommitdiffstats
path: root/URPM/Resolve.pm
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2016-10-16 12:43:49 +0200
committerAngelo Naselli <anaselli@linux.it>2016-10-16 12:43:49 +0200
commit070f1be3d5c3aa813f61d061c2a0fd38c2477c08 (patch)
treec0dcedc2a7f5d93e871462cf92762c27f2c84d72 /URPM/Resolve.pm
parentaeb63a76b34d99a91888a224da49f08926722cdd (diff)
downloadperl-URPM-070f1be3d5c3aa813f61d061c2a0fd38c2477c08.tar
perl-URPM-070f1be3d5c3aa813f61d061c2a0fd38c2477c08.tar.gz
perl-URPM-070f1be3d5c3aa813f61d061c2a0fd38c2477c08.tar.bz2
perl-URPM-070f1be3d5c3aa813f61d061c2a0fd38c2477c08.tar.xz
perl-URPM-070f1be3d5c3aa813f61d061c2a0fd38c2477c08.zip
mga#15353 don't crash if re is wrong
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r--URPM/Resolve.pm17
1 files 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 $@;
}
}