From 28158fb042056fb2d41f1b917176c92f5b3cafd2 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 8 May 2008 04:59:11 +0000 Subject: - handle gracefully locked RPM DB when trying to install some packages (#40244) --- NEWS | 2 ++ Rpmdrake/pkg.pm | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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 883113f0..06c88e55 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; -- cgit v1.2.1