diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-03-28 18:42:31 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-03-28 18:42:31 +0000 |
commit | faf71981ca6290846622e30166aaa7af5aff362d (patch) | |
tree | 09fb055859bd7e5bcade1e9a652eb10c7ed35b06 /Rpmdrake | |
parent | d1f0db42c00b6da04213a486c43fd01874fb6884 (diff) | |
download | rpmdrake-faf71981ca6290846622e30166aaa7af5aff362d.tar rpmdrake-faf71981ca6290846622e30166aaa7af5aff362d.tar.gz rpmdrake-faf71981ca6290846622e30166aaa7af5aff362d.tar.bz2 rpmdrake-faf71981ca6290846622e30166aaa7af5aff362d.tar.xz rpmdrake-faf71981ca6290846622e30166aaa7af5aff362d.zip |
(fast_open_urpmi_db) catch early errors too, thus enable to display a
graphical error message when debug environment does not exist
Diffstat (limited to 'Rpmdrake')
-rw-r--r-- | Rpmdrake/open_db.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Rpmdrake/open_db.pm b/Rpmdrake/open_db.pm index ee75badd..f5c76213 100644 --- a/Rpmdrake/open_db.pm +++ b/Rpmdrake/open_db.pm @@ -78,12 +78,18 @@ sub open_rpm_db { # do not pay the urpm::media::configure() heavy cost: sub fast_open_urpmi_db() { my $urpm = urpm->new; + my $error_happened; + $urpm->{fatal} = sub { + $error_happened = 1; + interactive_msg(N("Fatal error"), + N("A fatal error occurred: %s.", $_[1])); + }; + urpm::set_files($urpm, $::rpmdrake_options{'urpmi-root'}[0]) if $::rpmdrake_options{'urpmi-root'}[0]; $::rpmdrake_options{'rpm-root'}[0] ||= $::rpmdrake_options{'urpmi-root'}[0]; urpm::args::set_root($urpm, $::rpmdrake_options{'rpm-root'}[0]) if $::rpmdrake_options{'rpm-root'}[0]; urpm::args::set_debug($urpm) if $::rpmdrake_options{debug}; $urpm->get_global_options; - my $error_happened; $urpm->{options}{wait_lock} = $::rpmdrake_options{'wait-lock'}; $urpm->{options}{'verify-rpm'} = !$::rpmdrake_options{'no-verify-rpm'} if defined $::rpmdrake_options{'no-verify-rpm'}; $urpm->{options}{auto} = $::rpmdrake_options{auto} if defined $::rpmdrake_options{auto}; @@ -97,12 +103,6 @@ sub fast_open_urpmi_db() { $urpm::args::options{justdb} = $::rpmdrake_options{justdb}; - $urpm->{fatal} = sub { - $error_happened = 1; - interactive_msg(N("Fatal error"), - N("A fatal error occurred: %s.", $_[1])); - }; - urpm::media::read_config($urpm, 0); foreach (@{$urpm->{media}}) { next if $_->{ignore}; |