diff options
author | Francois Pons <fpons@mandriva.com> | 2002-06-19 13:14:34 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-06-19 13:14:34 +0000 |
commit | 887d931e41c313033a93d24601a91e5f33afe326 (patch) | |
tree | 2caf59c10843f52c09f3bd6ced58c878cb58c3a9 /urpmq | |
parent | 060e80e012a49ce46047bd7be982ba81ad8d7328 (diff) | |
download | urpmi-887d931e41c313033a93d24601a91e5f33afe326.tar urpmi-887d931e41c313033a93d24601a91e5f33afe326.tar.gz urpmi-887d931e41c313033a93d24601a91e5f33afe326.tar.bz2 urpmi-887d931e41c313033a93d24601a91e5f33afe326.tar.xz urpmi-887d931e41c313033a93d24601a91e5f33afe326.zip |
3.5-7mdk
Diffstat (limited to 'urpmq')
-rwxr-xr-x | urpmq | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -141,9 +141,14 @@ if (@src_names) { or $query->{force} or exit 1; } +#- keep track of choices, do no propagate but mark them in selected. +my $stop_on_choices = sub { + my ($urpm, $db, $state, $choices) = @_; + $state->{selected}{join '|', sort { $a <=> $b } map { $_ ? ($_->id) : () } @$choices} = 0; +}; #- open/close of database should be moved here, in order to allow testing #- some bogus case and check for integrity. -if ($query->{auto_select} || $query->{deps}) { +if ($query->{auto_select} || $query->{upgrade}) { my $db = URPM::DB::open($query->{root}); my $sig_handler = sub { undef $db; exit 3 }; local $SIG{INT} = $sig_handler; @@ -163,10 +168,17 @@ if ($query->{auto_select} || $query->{deps}) { #- filter to add in packages selected required packages. if ($query->{upgrade}) { - $query->{deps} and $urpm->resolve_requested($db, $state); - } else { #TODO fallback tempory... - $urpm->filter_packages_to_upgrade($db, $state->{requested}, undef, keep_alldeps => 1); + $urpm->resolve_requested($db, $state, callback_choices => $stop_on_choices); + #- dependancies are not asked, just clean selected part with added value (undef). + $query->{deps} or delete @{$state->{selected}}{grep { exists $state->{selected}{$_} && + ! defined $state->{selected}{$_}} keys %{$state->{selected}}}; } +} elsif ($query->{deps}) { + #- only deps required. + my $empty_db = new URPM; #- URPM has same methods as URPM::DB and empty URPM will be seen as empty URPM::DB. + require URPM::Resolve; + $urpm->resolve_requested($empty_db, $state, callback_choices => $stop_on_choices); + #$urpm->filter_packages_to_upgrade($db, $state->{requested}, undef, keep_alldeps => 1); } else { $state->{selected} = $state->{requested}; } |