diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-09-11 08:53:29 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-09-11 08:53:29 +0000 |
commit | 180517d0747a14ef222e7ca6cfcf022275d31450 (patch) | |
tree | ac61c17901ee58a0de451bda1bfc15ea51629a7c /urpm/get_pkgs.pm | |
parent | 1c94d634d02ab442e3df393e48f96a3aa83a39af (diff) | |
download | urpmi-180517d0747a14ef222e7ca6cfcf022275d31450.tar urpmi-180517d0747a14ef222e7ca6cfcf022275d31450.tar.gz urpmi-180517d0747a14ef222e7ca6cfcf022275d31450.tar.bz2 urpmi-180517d0747a14ef222e7ca6cfcf022275d31450.tar.xz urpmi-180517d0747a14ef222e7ca6cfcf022275d31450.zip |
simplify error handling
Diffstat (limited to 'urpm/get_pkgs.pm')
-rw-r--r-- | urpm/get_pkgs.pm | 16 |
1 files 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.", $_)); } |