diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-01-20 15:35:40 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-01-20 15:35:40 +0000 |
commit | bbaa064bb4b7640538441f60680525846d012c71 (patch) | |
tree | 6e7431c69dc6fcb4327411a452e8c693528db2b6 | |
parent | dc52add4c61e44756f231fa63b066c7019c3144e (diff) | |
download | rpmdrake-bbaa064bb4b7640538441f60680525846d012c71.tar rpmdrake-bbaa064bb4b7640538441f60680525846d012c71.tar.gz rpmdrake-bbaa064bb4b7640538441f60680525846d012c71.tar.bz2 rpmdrake-bbaa064bb4b7640538441f60680525846d012c71.tar.xz rpmdrake-bbaa064bb4b7640538441f60680525846d012c71.zip |
When displaying rpms by medium, display medium in the order they appear
in urpmi.cfg
-rwxr-xr-x | rpmdrake | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -619,7 +619,8 @@ or you already installed all of them.")); } @elems = map { [ $_, !$flat && ctreefy($pkgs->{$_}{pkg}->group) ] } @keys; } - my %sortmethods = (by_size => sub { sort { $pkgs->{$b->[0]}{pkg}->size <=> $pkgs->{$a->[0]}{pkg}->size } @_ }, + my %sortmethods = ( + by_size => sub { sort { $pkgs->{$b->[0]}{pkg}->size <=> $pkgs->{$a->[0]}{pkg}->size } @_ }, by_selection => sub { sort { $pkgs->{$b->[0]}{selected} <=> $pkgs->{$a->[0]}{selected} || uc($a->[0]) cmp uc($b->[0]) } @_ }, by_leaves => sub { @@ -627,6 +628,7 @@ or you already installed all of them.")); sort { $b->[1] <=> $a->[1] } grep { exists $pkgs->{$_->[0]} } map { [ split ] } `$pkgs_times`; }, flat => sub { sort { uc($a->[0]) cmp uc($b->[0]) } @_ }, + by_medium => sub { sort { $a->[3] <=> $b->[3] || uc($a->[0]) cmp uc($b->[0]) } @_ }, ); if ($flat) { $add_node->($_->[0], '') foreach $sortmethods{$mode || 'flat'}->(@elems); @@ -635,7 +637,9 @@ or you already installed all of them.")); $add_node->($_->[0], N("All")) foreach $sortmethods{flat}->(@elems); $tree->expand_row($tree_model->get_path($tree_model->get_iter_first), 0); } elsif ($mode eq 'by_source') { - $add_node->($_->[0], pkg2medium($pkgs->{$_->[0]}{pkg}, $urpm)->{name}) foreach $sortmethods{flat}->(@elems); + $add_node->($_->[0], $_->[2]) foreach $sortmethods{by_medium}->(map { + my $m = pkg2medium($pkgs->{$_->[0]}{pkg}, $urpm); [ @$_, $m->{name}, $m->{priority} ]; + } @elems); } elsif ($mode eq 'by_presence') { $add_node->( $_->[0], $pkgs->{$_->[0]}{pkg}->flag_installed && !$pkgs->{$_->[0]}{pkg}->flag_skip |