aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-28 18:42:31 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-28 18:42:31 +0000
commitfaf71981ca6290846622e30166aaa7af5aff362d (patch)
tree09fb055859bd7e5bcade1e9a652eb10c7ed35b06
parentd1f0db42c00b6da04213a486c43fd01874fb6884 (diff)
downloadrpmdrake-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
-rw-r--r--NEWS2
-rw-r--r--Rpmdrake/open_db.pm14
2 files changed, 9 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 9190a60c..f22c9fdc 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- display a graphical error message when debug environment does not exist
+
Version 5.32 - 26 March 2012, Thierry Vignaud
- rpmdrake:
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};