diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-02-25 19:20:25 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-02-25 19:20:25 +0000 |
commit | 62351b2809381dfc0f3baf7044b84f7f9971236f (patch) | |
tree | 281b582fac9081e4552bc640274a114fca7e6761 /Rpmdrake/gui.pm | |
parent | e60c4465770d4f00e66072ba624961de3416e34b (diff) | |
download | rpmdrake-62351b2809381dfc0f3baf7044b84f7f9971236f.tar rpmdrake-62351b2809381dfc0f3baf7044b84f7f9971236f.tar.gz rpmdrake-62351b2809381dfc0f3baf7044b84f7f9971236f.tar.bz2 rpmdrake-62351b2809381dfc0f3baf7044b84f7f9971236f.tar.xz rpmdrake-62351b2809381dfc0f3baf7044b84f7f9971236f.zip |
(is_updatable) split it out of pkgs_provider() for readability
Diffstat (limited to 'Rpmdrake/gui.pm')
-rw-r--r-- | Rpmdrake/gui.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index e32048cd..2b494110 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -478,6 +478,11 @@ sub switch_pkg_list_mode { $filter_methods{$mode}->(); } +sub is_updatable { + my $p = $pkgs->{$_[0]}; + $p->{pkg} && !$p->{selected} && $p->{pkg}->flag_installed && $p->{pkg}->flag_upgrade; +} + sub pkgs_provider { my ($options, $mode, %options) = @_; return if !$mode; @@ -489,7 +494,8 @@ sub pkgs_provider { installed => sub { @filtered_pkgs = @{$h->{installed}} }, non_installed => sub { @filtered_pkgs = @{$h->{installable}} }, all_updates => sub { - my @pkgs = $options{pure_updates} ? () : (grep { my $p = $pkgs->{$_}; $p->{pkg} && !$p->{selected} && $p->{pkg}->flag_installed && $p->{pkg}->flag_upgrade } @{$h->{installable}}); + my @pkgs = $options{pure_updates} ? () : + (grep { is_updatable($_) } @{$h->{installable}}); @filtered_pkgs = @{$h->{updates}}, @pkgs; }, backports => sub { @filtered_pkgs = @{$h->{backports}} }, |