aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/gui.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Rpmdrake/gui.pm')
-rw-r--r--Rpmdrake/gui.pm21
1 files changed, 13 insertions, 8 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index e3a73cb25..09cfbd83 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -633,15 +633,22 @@ sub toggle_nodes {
my @nodes_with_deps;
my $bar_id = statusbar_msg(N("Checking dependencies of package..."), 0);
+
+ my $warn_about_additional_packages_to_remove = sub {
+ my ($msg) = @_;
+ statusbar_msg_remove($bar_id);
+ deps_msg(N("Some additional packages need to be removed"),
+ formatAlaTeX($msg) . "\n\n",
+ \@nodes, \@nodes_with_deps) or @nodes_with_deps = ();
+ };
+
if (member($old_state, qw(to_remove installed))) { # remove pacckages
if ($new_state) {
my @remove;
slow_func($widget, sub { @remove = closure_removal(@nodes) });
@nodes_with_deps = grep { !$pkgs->{$_}{selected} && !/^basesystem/ } @remove;
- statusbar_msg_remove($bar_id);
- deps_msg(N("Some additional packages need to be removed"),
- formatAlaTeX(N("Because of their dependencies, the following package(s) also need to be\nremoved:")) . "\n\n",
- \@nodes, \@nodes_with_deps) or @nodes_with_deps = ();
+ $warn_about_additional_packages_to_remove->(
+ N("Because of their dependencies, the following package(s) also need to be\nremoved:"));
my @impossible_to_remove;
foreach (grep { exists $pkgs->{$_}{base} } @remove) {
${$pkgs->{$_}{base}} == 1 ? push @impossible_to_remove, $_ : ${$pkgs->{$_}{base}}--;
@@ -655,10 +662,8 @@ sub toggle_nodes {
sub { @nodes_with_deps = grep { intersection(\@nodes, [ closure_removal($_) ]) }
grep { $pkgs->{$_}{selected} && !member($_, @nodes) } keys %$pkgs });
push @nodes_with_deps, @nodes;
- statusbar_msg_remove($bar_id);
- deps_msg(N("Some additional packages need to be removed"),
- N("Because of their dependencies, the following package(s) must be\nunselected now:\n\n"),
- \@nodes, \@nodes_with_deps) or @nodes_with_deps = ();
+ $warn_about_additional_packages_to_remove->(
+ N("Because of their dependencies, the following package(s) must be\nunselected now:\n\n"));
$pkgs->{$_}{base} && ${$pkgs->{$_}{base}}++ foreach @nodes_with_deps;
}
} else {