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 | |
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
-rw-r--r-- | urpmi.spec | 6 | ||||
-rwxr-xr-x | urpmq | 20 |
2 files changed, 21 insertions, 5 deletions
@@ -2,7 +2,7 @@ Name: urpmi Version: 3.5 -Release: 6mdk +Release: 7mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate @@ -144,6 +144,10 @@ fi %changelog +* Wed Jun 19 2002 François Pons <fpons@mandrakesoft.com> 3.5-7mdk +- fixed urpmq to no more use old resolution methods in urpm.pm. +- fixed urpmq to take care of choices correctly (no default selection). + * Tue Jun 18 2002 François Pons <fpons@mandrakesoft.com> 3.5-6mdk - fixed --bug on required file not provided for generating rpmdb.cz. @@ -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}; } |