aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-09-07 17:45:24 +0000
committerThierry Vignaud <tv@mageia.org>2012-09-07 17:45:24 +0000
commit3fc29a60a1c5c2809911c6f9ebb37ad493d5d42c (patch)
tree0080903594a27acaa2ee83894847cafdb93ffe4a
parent5a86d84883782bd1ae4de4e4b03ef007d33bf91b (diff)
downloadrpmdrake-3fc29a60a1c5c2809911c6f9ebb37ad493d5d42c.tar
rpmdrake-3fc29a60a1c5c2809911c6f9ebb37ad493d5d42c.tar.gz
rpmdrake-3fc29a60a1c5c2809911c6f9ebb37ad493d5d42c.tar.bz2
rpmdrake-3fc29a60a1c5c2809911c6f9ebb37ad493d5d42c.tar.xz
rpmdrake-3fc29a60a1c5c2809911c6f9ebb37ad493d5d42c.zip
make failing to open RPM DB non fatal when reseting selection (mga#7352)
-rw-r--r--NEWS3
-rwxr-xr-xrpmdrake7
2 files changed, 9 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 9929b001..24a1ba74 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- rpmdrake:
+ o make failing to open RPM DB non fatal when reseting selection (mga#7352)
+
Version 5.36 - 31 August 2012, Pascal Terjan
- adapt to urpmi-7.5
diff --git a/rpmdrake b/rpmdrake
index 31700da0..4af44535 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -550,8 +550,13 @@ sub run_treeview_dialog {
),
[ N("/_File") . N("/_Reset the selection"), undef, sub {
if ($MODE ne 'remove') {
+ my $db = eval { open_rpm_db() };
+ if (!ref($db)) {
+ statusbar_msg(N("Reset aborted (RPM DB is locked by another process)"), 1);
+ return;
+ };
$urpm->disable_selected(
- open_rpm_db(), $urpm->{state},
+ $db, $urpm->{state},
map { if_($pkgs->{$_}{selected}, $pkgs->{$_}{pkg}) } keys %$pkgs,
);
}