aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-05-08 04:59:00 +0000
committerThierry Vignaud <tv@mandriva.org>2008-05-08 04:59:00 +0000
commit8181c02c47ec4ad9c828a808afc28ba8b94a6250 (patch)
treefd681ad1574bfec63a46951b961aa618143075ed
parent0cf523dde2d5af5bda224fdb9caf0177b8a126ae (diff)
downloadrpmdrake-8181c02c47ec4ad9c828a808afc28ba8b94a6250.tar
rpmdrake-8181c02c47ec4ad9c828a808afc28ba8b94a6250.tar.gz
rpmdrake-8181c02c47ec4ad9c828a808afc28ba8b94a6250.tar.bz2
rpmdrake-8181c02c47ec4ad9c828a808afc28ba8b94a6250.tar.xz
rpmdrake-8181c02c47ec4ad9c828a808afc28ba8b94a6250.zip
- handle gracefully locked RPM DB when trying to install some packages
(#40244)
-rw-r--r--NEWS2
-rw-r--r--Rpmdrake/pkg.pm7
2 files changed, 8 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 9df424b0..2fde6b71 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- handle gracefully locked RPM DB when trying to install some packages
+ (#40244)
- rpmdrake:
o fix a crash when default view is unknown (#40025)
o fix searching when numeric pad's return key is pressed
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index d4e83895..66d02607 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -374,7 +374,12 @@ sub get_pkgs {
$gurpm->label(N("Please wait, listing base packages..."));
$gurpm->progress($level);
- my $db = open_rpm_db();
+ my $db = eval { open_rpm_db() };
+ if (my $err = $@) {
+ interactive_msg(N("Error"), N("A fatal error occurred: %s.", $err));
+ return;
+ }
+
my $sig_handler = sub { undef $db; exit 3 };
local $SIG{INT} = $sig_handler;
local $SIG{QUIT} = $sig_handler;