aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM/Resolve.pm29
-rw-r--r--perl-URPM.spec8
2 files changed, 25 insertions, 12 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 54719ad..73098d5 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -237,16 +237,21 @@ sub backtrack_selected {
#- at this point, dep cannot be resolved, this means we need to disable
#- all selection tree, re-enabling removed and obsoleted packages as well.
if (defined $dep->{from}) {
- print STDERR "backtracking from ".$dep->{from}->fullname."\n";
- my @l = $urpm->disable_selected($db, $state, $dep->{from});
- foreach (@l) {
- #- disable all these packages in order to avoid selecting them again.
- $state->{rejected}{$_->fullname}{backtrack} = 1;
+ unless (exists $state->{rejected}{$dep->{from}->fullname}) {
+ #- package is not currently rejected, compute the closure now.
+ my @l = $urpm->disable_selected($db, $state, $dep->{from});
+ foreach (@l) {
+ #- disable all these packages in order to avoid selecting them again.
+ $_->fullname eq $dep->{from}->fullname or
+ $state->{rejected}{$_->fullname}{backtrack}{closure}{$dep->{from}->fullname} = undef;
+ }
}
+ #- the package is already rejected, we assume we can add another reason here!
+ push @{$state->{rejected}{$dep->{from}->fullname}{backtrack}{unsatisfied}}, $dep->{required};
}
- #- it could happen if removed is used, in such case, the remove should be canceled.
- #TODO
+ #- some packages may have been removed because of selection of this one.
+ #- the rejected flags should have been cleaned by disable_selected above.
();
}
@@ -327,7 +332,7 @@ sub resolve_rejected {
#- check : check requires of installed packages.
sub resolve_requested {
my ($urpm, $db, $state, $requested, %options) = @_;
- my (@properties, $dep);
+ my ($dep, @properties, @selected);
#- populate properties with backtrack informations.
while (my ($r, $v) = each %$requested) {
@@ -412,6 +417,7 @@ sub resolve_requested {
#- keep in mind the package has be selected, remove the entry in requested input hash,
#- this means required dependencies have undef value in selected hash.
#- requested flag is set only for requested package where value is not false.
+ push @selected, $pkg;
$state->{selected}{$pkg->id} = { exists $dep->{requested} ? (requested => $dep->{requested}) : @{[]},
exists $dep->{from} ? (from => $dep->{from}) : @{[]},
};
@@ -435,7 +441,7 @@ sub resolve_requested {
$p->name eq $n && (!$o || eval($p->compare($v) . $o . 0)) or next;
}
#- these packages are not yet selected, if they happens to be selected,
- #- they must first be unselected. TODO
+ #- they must first be unselected.
$state->{rejected}{$p->fullname}{closure}{$pkg->fullname} = undef;
}
#- examine rpm db too.
@@ -571,8 +577,9 @@ sub resolve_requested {
});
}
- #- return what has been selected by this call (not all selected hash).
- #TODO
+ #- return what has been selected by this call (not all selected hash which may be not emptry
+ #- previously. avoid returning rejected package which have not be selectable.
+ grep { exists $state->{selected}{$_->id} } @selected;
}
#- do the opposite of the above, unselect a package and extend
diff --git a/perl-URPM.spec b/perl-URPM.spec
index 0e028f6..85e9f15 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -1,7 +1,7 @@
%define name perl-URPM
%define real_name URPM
%define version 0.90
-%define release 1mdk
+%define release 2mdk
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -51,6 +51,12 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon May 26 2003 François Pons <fpons@mandrakesoft.com> 0.90-2mdk
+- fixed URPM::resolve_requested return value (list of package
+ selected by this call).
+- fixed backtrack reason to be stored in rejected hash (so that
+ urpmi can say why a package is not selected).
+
* Fri May 23 2003 François Pons <fpons@mandrakesoft.com> 0.90-1mdk
- extended URPM::search with newer/modified options.
- fixed URPM::Package::compare_pkg to work with identical