From 7bf39e3ab3e48f2eac30f0dce3060dfc10d1086d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 8 May 2008 05:00:11 +0000 Subject: - handle gracefully locked RPM DB when trying to install some packages (#40244) --- .perl_checker | 1 + Rpmdrake/pkg.pm | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.perl_checker b/.perl_checker index badba578..90136074 100644 --- a/.perl_checker +++ b/.perl_checker @@ -5,6 +5,7 @@ Date::Manip Digest::Perl::MD5 Digest::base Encode +feature File::Basename File::Find File::FnMatch diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 71a025df..761e97db 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -277,7 +277,12 @@ sub get_pkgs { my @base = ("basesystem", split /,\s*/, $urpm->{global_config}{'prohibit-remove'}); my (%base, %basepackages); - 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