aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2006-11-27 18:30:38 +0000
committerThierry Vignaud <tv@mandriva.org>2006-11-27 18:30:38 +0000
commit87bf3c13646386ed10f756006b345bd22ae22019 (patch)
treebee6472dac3675e90deba27f8a7d02dc5f2da38b
parente671ebc69f87fb53dcf50f8f8f0ac5d5d5744567 (diff)
downloadrpmdrake-87bf3c13646386ed10f756006b345bd22ae22019.tar
rpmdrake-87bf3c13646386ed10f756006b345bd22ae22019.tar.gz
rpmdrake-87bf3c13646386ed10f756006b345bd22ae22019.tar.bz2
rpmdrake-87bf3c13646386ed10f756006b345bd22ae22019.tar.xz
rpmdrake-87bf3c13646386ed10f756006b345bd22ae22019.zip
set the initial selection for updates (#25271)
-rwxr-xr-xrpmdrake9
1 files changed, 7 insertions, 2 deletions
diff --git a/rpmdrake b/rpmdrake
index 1feea496..3cc9aae3 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -762,7 +762,7 @@ sub format_pkg_info {
sub run_treeview_dialog {
my ($callback_action) = @_;
my ($urpm, $pkgs, $descriptions);
- my (%filter_methods, $force_displaying_group);
+ my (%filter_methods, $force_displaying_group, @initial_selection, $initial_selection_done);
my $switch_pkg_list_mode = sub {
my ($mode) = @_;
return if !$mode;
@@ -789,6 +789,11 @@ sub run_treeview_dialog {
#security => sub { $pkgs = },
#normal => sub { $pkgs = }
);
+ if (!$initial_selection_done) {
+ $filter_methods{all}->();
+ @initial_selection = grep { $pkgs->{$_}{selected} } keys %$pkgs;
+ $initial_selection_done = 1;
+ }
foreach my $importance (qw(bugfix security normal)) {
$filter_methods{$importance} = sub {
$pkgs = $h->{updates};
@@ -1119,7 +1124,7 @@ or you already installed all of them."));
rebuild_tree => sub {},
};
- if (my @initial_selection = grep { $pkgs->{$_}{selected} } keys %$pkgs) {
+ if (@initial_selection) {
$options->{initial_selection} = \@initial_selection;
$pkgs->{$_}{selected} = 0 foreach @initial_selection;
}