aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xMandrivaUpdate2
-rw-r--r--Rpmdrake/gui.pm26
-rwxr-xr-xRpmdrake/pkg.pm26
3 files changed, 27 insertions, 27 deletions
diff --git a/MandrivaUpdate b/MandrivaUpdate
index 69edf3f0..0da659e3 100755
--- a/MandrivaUpdate
+++ b/MandrivaUpdate
@@ -55,7 +55,7 @@ open_db();
sub refresh_packages_list {
my ($list, $info, $button) = @_;
# select packages to update:
- my @requested = sort keys %$pkgs;
+ my @requested = sort @filtered_pkgs;
# don't select kernel*-latest by default and the kernels they require:
foreach my $name (@requested) {
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index cc0a703d..9763d4a6 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -40,11 +40,11 @@ use Rpmdrake::icon;
use Gtk2::Gdk::Keysyms;
our @EXPORT = qw(ask_browse_tree_given_widgets_for_rpmdrake build_tree callback_choices closure_removal compute_main_window_size do_action get_info is_locale_available pkgs_provider reset_search set_node_state switch_pkg_list_mode toggle_nodes
- $clear_button %grp_columns %pkg_columns $dont_show_selections $find_entry $force_displaying_group $force_rebuild @initial_selection $pkgs $size_free $size_selected $urpm);
+ $clear_button %grp_columns %pkg_columns $dont_show_selections @filtered_pkgs $find_entry $force_displaying_group $force_rebuild @initial_selection $pkgs $size_free $size_selected $urpm);
our $dont_show_selections = $> ? 1 : 0;
-our ($descriptions, %filter_methods, $force_displaying_group, $force_rebuild, @initial_selection, $pkgs, $size_free, $size_selected, $urpm);
+our ($descriptions, @filtered_pkgs, %filter_methods, $force_displaying_group, $force_rebuild, @initial_selection, $pkgs, $size_free, $size_selected, $urpm);
our %grp_columns = (
label => 0,
@@ -428,24 +428,22 @@ sub pkgs_provider {
return if !$mode;
my $h = &get_pkgs($urpm, $options); # was given (1, @_) for updates
($urpm, $descriptions) = @$h{qw(urpm update_descr)};
+ $pkgs = $h->{all_pkgs};
%filter_methods = (
- all => sub { $pkgs = { map { %{$h->{$_}} } qw(installed installable updates) } },
- installed => sub { $pkgs = $h->{installed} },
- non_installed => sub { $pkgs = $h->{installable} },
+ all => sub { @filtered_pkgs = map { @$_} @$h{qw(installed installable updates)} },
+ installed => sub { @filtered_pkgs = @{$h->{installed}} },
+ non_installed => sub { @filtered_pkgs = @{$h->{installable}} },
all_updates => sub {
- my @pkgs = $options{pure_updates} ? () : (grep { my $p = $h->{installable}{$_}; $p->{pkg} && !$p->{selected} && $p->{pkg}->flag_installed && $p->{pkg}->flag_upgrade } keys %{$h->{installable}});
- $pkgs = {
- (map { $_ => $h->{updates}{$_} } keys %{$h->{updates}}),
- (map { $_ => $h->{installable}{$_} } @pkgs)
- };
+ my @pkgs = $options{pure_updates} ? () : (grep { my $p = $pkgs->{$_}; $p->{pkg} && !$p->{selected} && $p->{pkg}->flag_installed && $p->{pkg}->flag_upgrade } @{$h->{installable}});
+ @filtered_pkgs = @{$h->{updates}}, @pkgs;
},
);
foreach my $importance (qw(bugfix security normal)) {
$filter_methods{$importance} = sub {
- $pkgs = $h->{updates};
- $pkgs = { map { $_ => $pkgs->{$_} } grep {
+ @filtered_pkgs = $h->{updates};
+ @filtered_pkgs = { map { $_ => @filtered_pkgs->{$_} } grep {
my ($name, $_version) = split_fullname($_);
- $descriptions->{$name}{importance} eq $importance } keys %$pkgs };
+ $descriptions->{$name}{importance} eq $importance } @filtered_pkgs };
};
}
$filter_methods{mandrake_choices} = $filter_methods{non_installed};
@@ -701,7 +699,7 @@ sub build_tree {
push @elems, [ $pkg, $_ ] foreach @{$compssUsers->{$name}};
}
} else {
- my @keys = keys %$pkgs;
+ my @keys = @filtered_pkgs;
if (member($mode, qw(all_updates security bugfix normal))) {
@keys = grep {
my ($name) = split_fullname($_);
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 2bc2d11a..34f3070d 100755
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -325,22 +325,23 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1);
Rpmdrake::gurpm::label(N("Please wait, finding installed packages..."));
Rpmdrake::gurpm::progress($level = 0.33);
$reset_update->(0.66);
- my %installed_pkgs;
+ my (@installed_pkgs, %all_pkgs);
if (!$probe_only_for_updates) {
$db->traverse(sub {
my ($pkg) = @_;
$update->();
my $fullname = urpm_name($pkg);
#- Extract summary and description since they'll be lost when the header is packed
- $installed_pkgs{$fullname} = {
+ $all_pkgs{$fullname} = {
selected => 0, pkg => $pkg, urpm_name => urpm_name($pkg),
summary => rpm_summary($pkg->summary),
description => rpm_description($pkg->description),
- } if !($installed_pkgs{$fullname} && $installed_pkgs{$fullname}{description});
+ } if !($all_pkgs{$fullname} && $all_pkgs{$fullname}{description});
if (my $name = $base{$fullname}) {
- $installed_pkgs{$fullname}{base} = \$name;
+ $all_pkgs{$fullname}{base} = \$name;
$pkg->set_flag_base(1) if $$name == 1;
}
+ push @installed_pkgs, $fullname;
$pkg->pack_header; # needed in order to call methods on objects outside ->traverse
});
my $group;
@@ -354,8 +355,7 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1);
#$urpm = urpm->new;
$urpm->{state} = {};
- my %installable_pkgs;
- my %updates;
+ my (@installable_pkgs, @updates);
Rpmdrake::gurpm::label(N("Please wait, finding available packages..."));
Rpmdrake::gurpm::progress($level = 0.66);
@@ -401,22 +401,24 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1);
# selecting updates by default:
$selected = 1 if $probe_only_for_updates;
}
- $updates{$name} = { selected => $selected, pkg => $pkg };
+ push @updates, $name;
} else {
- $installable_pkgs{$name} = { selected => $selected, pkg => $pkg };
+ push @installable_pkgs, $name;
}
+ $all_pkgs{urpm_name($pkg)} = { selected => $selected, pkg => $pkg };
}
if ($::options{'pkg-sel'} && $::options{'pkg-nosel'}) {
push @{$::options{'pkg-nosel'}}, @{$::options{'pkg-sel'}};
delete $::options{'pkg-sel'};
}
- $_->{pkg}->set_flag_installed foreach values %installed_pkgs;
+ $all_pkgs{$_}{pkg}->set_flag_installed foreach @installed_pkgs;
+{ urpm => $urpm,
- installed => \%installed_pkgs,
- installable => \%installable_pkgs,
- updates => \%updates,
+ all_pkgs => \%all_pkgs,
+ installed => \@installed_pkgs,
+ installable => \@installable_pkgs,
+ updates => \@updates,
update_descr => \%update_descr,
};
}