diff options
author | Francois Pons <fpons@mandriva.com> | 2001-08-29 18:00:15 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-08-29 18:00:15 +0000 |
commit | 3b4d26e88c788cf1aee710fe9b43653c944c9384 (patch) | |
tree | a7919f15557414d363716f319422badedd3f0876 /urpm.pm | |
parent | e2f6e178f6cbd8da5cc2250297faa7efbfa4dc9d (diff) | |
download | urpmi-3b4d26e88c788cf1aee710fe9b43653c944c9384.tar urpmi-3b4d26e88c788cf1aee710fe9b43653c944c9384.tar.gz urpmi-3b4d26e88c788cf1aee710fe9b43653c944c9384.tar.bz2 urpmi-3b4d26e88c788cf1aee710fe9b43653c944c9384.tar.xz urpmi-3b4d26e88c788cf1aee710fe9b43653c944c9384.zip |
gloup.
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -1069,16 +1069,24 @@ sub compute_closure { exists $packages->{$_} && ! ref $packages->{$_} and $follow_id = $_, last; $installed && exists $installed->{$_} and push @upgradable_choices, $_; } - unless ($follow_id) { + unless (defined $follow_id) { #- if there are at least one upgradable choice, use it instead #- of asking the user to chose among a list. if (@upgradable_choices == 1) { push @packages, $upgradable_choices[0]; } else { @upgradable_choices > 1 and @choices = @upgradable_choices; - $select_choices and push @packages, $select_choices->($urpm, @choices); - foreach (@choices) { - push @{$packages->{$_} ||= []}, \@choices; + #- propose the choice to the user now, or select the best one (as it is supposed to be). + my @selection = $select_choices ? ($select_choices->($urpm, $id, @choices)) : (); + if (@selection) { + foreach (@selection) { + unshift @packages, $_; + exists $packages->{$_} or $packages->{$_} = 1; + } + } else { + foreach (@choices) { + push @{$packages->{$_} ||= []}, \@choices; + } } } } @@ -1298,7 +1306,7 @@ sub filter_minimal_packages_to_upgrade { defined $id or next; #- propose the choice to the user now, or select the best one (as it is supposed to be). - my @selection = $select_choices ? ($select_choices->($urpm, @$id)) : ($id->[0]); + my @selection = $select_choices ? ($select_choices->($urpm, undef, @$id)) : ($id->[0]); foreach (@selection) { unshift @packages, $_; exists $packages->{$_} or $packages->{$_} = 1; |