From 180517d0747a14ef222e7ca6cfcf022275d31450 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 11 Sep 2007 08:53:29 +0000 Subject: simplify error handling --- urpm/get_pkgs.pm | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm index 047da8fa..268bb212 100644 --- a/urpm/get_pkgs.pm +++ b/urpm/get_pkgs.pm @@ -63,7 +63,7 @@ sub selected2list { } } - my ($error, @list_error, @list, %examined); + my (@list, %examined); foreach my $medium (@{$urpm->{media} || []}) { my (%sources, %list_examined, $list_warning); @@ -89,17 +89,10 @@ sub selected2list { } } else { chomp; - $error = 1; $urpm->{error}(N("unable to correctly parse [%s] on value \"%s\"", urpm::media::statedir_list($urpm, $medium), $_)); last; } } - } else { - # list file exists but isn't readable - # report error only if no result found, list files are only readable by root - push @list_error, N("unable to access list file of \"%s\", medium ignored", $medium->{name}); - $< and push @list_error, " " . N("(retry as root?)"); - next; } } if (defined $medium->{url}) { @@ -125,19 +118,14 @@ sub selected2list { $list_warning && $medium->{list} && -r urpm::media::statedir_list($urpm, $medium) && -f _ and $urpm->{error}(N("medium \"%s\" uses an invalid list file: mirror is probably not up-to-date, trying to use alternate method", $medium->{name})); - } elsif (!%list_examined) { - $error = 1; - $urpm->{error}(N("medium \"%s\" does not define any location for rpm files", $medium->{name})); } } push @list, \%sources; } + my $error; #- examine package list to see if a package has not been found. foreach (grep { ! exists($examined{$_}) } keys %fullname2id) { - # print list errors only once if any - $urpm->{error}($_) foreach @list_error; - @list_error = (); $error = 1; $urpm->{error}(N("package %s is not found.", $_)); } -- cgit v1.2.1