diff options
author | Thierry Vignaud <tv@mandriva.org> | 2006-10-13 14:58:24 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2006-10-13 14:58:24 +0000 |
commit | ba2b8cdb14141f929b0ef0b04d0e24c1f2b04b0a (patch) | |
tree | e674aeb8b93cd8baa8a74d2c7946cd8fbf3b65eb | |
parent | 11d391d187f1dc9e55865f5c5188cfde7aa78a42 (diff) | |
download | rpmdrake-ba2b8cdb14141f929b0ef0b04d0e24c1f2b04b0a.tar rpmdrake-ba2b8cdb14141f929b0ef0b04d0e24c1f2b04b0a.tar.gz rpmdrake-ba2b8cdb14141f929b0ef0b04d0e24c1f2b04b0a.tar.bz2 rpmdrake-ba2b8cdb14141f929b0ef0b04d0e24c1f2b04b0a.tar.xz rpmdrake-ba2b8cdb14141f929b0ef0b04d0e24c1f2b04b0a.zip |
(get_pkgs) set up a fatal error handler earlier so that urpmi doesn't
kill us on first urpmi database opening when /etc/urpmi/urpmi.cfg
doesn't exists (seen in #26533)
-rwxr-xr-x | rpmdrake | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1428,8 +1428,18 @@ sub get_pkgs { my %update_descr; my @update_medias; + my $error_happened; + my $fatal_handler = sub { + $error_happened = 1; + interactive_msg_(N("Fatal error"), + N("A fatal error occurred: %s.", $_[1])); + myexit(-1) if 0; #FIXME + }; + + if (!$urpm) { $urpm ||= urpm->new; + $urpm->{fatal} = $fatal_handler; my $media = ref $options{media} ? join(',', @{$options{media}}) : ''; $urpm->configure(media => $media); } @@ -1437,11 +1447,7 @@ sub get_pkgs { @update_medias = grep { !$_->{ignore} && $_->{update} } @{$urpm->{media}}; - $urpm->{fatal} = sub { - interactive_msg_(N("Fatal error"), - N("A fatal error occurred: %s.", $_[1])); - myexit(-1) if 0; #FIXME - }; + $urpm->{fatal} = $fatal_handler; if (member($default_list_mode, qw(all_updates security bugfix normal))) { unless ($options{'no-media-update'}) { if (@update_medias > 0) { |