From f0c6b087e508d61a8f6ae7ae9d434622966edaf1 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 1 Oct 2009 11:32:35 +0000 Subject: (is_there_selected_packages) extract it from do_action__real() (needed for next commit) --- Rpmdrake/gui.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Rpmdrake') 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; } -- cgit v1.2.1