diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-05-08 05:00:11 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-05-08 05:00:11 +0000 |
commit | 7bf39e3ab3e48f2eac30f0dce3060dfc10d1086d (patch) | |
tree | f42a632a69859dc3550d973e556c689d612d14db | |
parent | 0780a3e4f213472018e4ebabd78f0e99f22724d7 (diff) | |
download | rpmdrake-7bf39e3ab3e48f2eac30f0dce3060dfc10d1086d.tar rpmdrake-7bf39e3ab3e48f2eac30f0dce3060dfc10d1086d.tar.gz rpmdrake-7bf39e3ab3e48f2eac30f0dce3060dfc10d1086d.tar.bz2 rpmdrake-7bf39e3ab3e48f2eac30f0dce3060dfc10d1086d.tar.xz rpmdrake-7bf39e3ab3e48f2eac30f0dce3060dfc10d1086d.zip |
- handle gracefully locked RPM DB when trying to install some packages
(#40244)
-rw-r--r-- | .perl_checker | 1 | ||||
-rw-r--r-- | Rpmdrake/pkg.pm | 7 |
2 files changed, 7 insertions, 1 deletions
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; |