summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpmi.spec6
-rwxr-xr-xurpmq20
2 files changed, 21 insertions, 5 deletions
diff --git a/urpmi.spec b/urpmi.spec
index 09291b27..110c2903 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -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.
diff --git a/urpmq b/urpmq
index 4c70eaff..10ac4d4c 100755
--- a/urpmq
+++ b/urpmq
@@ -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};
}