diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-10-01 11:32:35 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-10-01 11:32:35 +0000 |
commit | f0c6b087e508d61a8f6ae7ae9d434622966edaf1 (patch) | |
tree | fa80cde291df36becf11c1afe599d675c38f92a1 | |
parent | 713c69a80a214b447d64a84e78065b63046a1715 (diff) | |
download | rpmdrake-f0c6b087e508d61a8f6ae7ae9d434622966edaf1.tar rpmdrake-f0c6b087e508d61a8f6ae7ae9d434622966edaf1.tar.gz rpmdrake-f0c6b087e508d61a8f6ae7ae9d434622966edaf1.tar.bz2 rpmdrake-f0c6b087e508d61a8f6ae7ae9d434622966edaf1.tar.xz rpmdrake-f0c6b087e508d61a8f6ae7ae9d434622966edaf1.zip |
(is_there_selected_packages) extract it from do_action__real() (needed
for next commit)
-rw-r--r-- | Rpmdrake/gui.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index 96a07d6f..9b63ddb8 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -799,6 +799,10 @@ sub toggle_nodes { } } +sub is_there_selected_packages() { + int(grep { $pkgs->{$_}{selected} } keys %$pkgs) +} + sub do_action__real { my ($options, $callback_action, $o_info) = @_; require urpm::sys; @@ -806,7 +810,7 @@ sub do_action__real { $urpm->{fatal}(1, N("Error: %s appears to be mounted read-only.", $urpm::sys::mountpoint)); return 1; } - if (!$Rpmdrake::pkg::need_restart && !int(grep { $pkgs->{$_}{selected} } keys %$pkgs)) { + if (!$Rpmdrake::pkg::need_restart && !is_there_selected_packages()) { interactive_msg(N("You need to select some packages first."), N("You need to select some packages first.")); return 1; } |