aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM/Resolve.pm27
-rw-r--r--perl-URPM.spec13
2 files changed, 27 insertions, 13 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index fb7f8b8..612e69c 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -141,7 +141,8 @@ sub unsatisfied_requires {
my ($urpm, $db, $state, $pkg, %options) = @_;
my %properties;
- #- all requires should be satisfied according to selected package, or installed packages.
+ #- all requires should be satisfied according to selected packages or installed packages,
+ #- or the package itself.
REQUIRES: foreach my $dep ($pkg->requires) {
if (my ($n, $s) = $dep =~ /^([^\s\[]*)(?:\[\*\])?\[?([^\s\]]*\s*[^\s\]]*)/) {
#- allow filtering on a given name (to speed up some search).
@@ -170,6 +171,11 @@ sub unsatisfied_requires {
}
}
+ #- check if the package itself provides what is necessary.
+ foreach ($pkg->provides) {
+ ranges_overlap($_, $dep) and next REQUIRES;
+ }
+
#- check on installed system a package which is not obsoleted is satisfying the require.
my $satisfied = 0;
if ($n =~ /^\//) {
@@ -512,28 +518,25 @@ sub resolve_requested {
foreach my $n (keys %diff_provides) {
$db->traverse_tag('whatrequires', [ $n ], sub {
my ($p) = @_;
- if (my @l = $urpm->unsatisfied_requires($db, $state, $p, nopromoteepoch => 0)) {
- #- try if upgrading the package will be satisfying all the requires
- #- else it will be necessary to ask the user for removing it.
- my $packages = $urpm->find_candidate_packages($p->name,
- nopromoteepoch => 0,
- avoided => $state->{rejected});
+ if (my @l = $urpm->unsatisfied_requires($db, $state, $p, nopromoteepoch => 1, name => $n)) {
+ #- try if upgrading the package will be satisfying all the requires...
+ #- there is no need to avoid promoting epoch as the package examined is not
+ #- already installed.
+ my $packages = $urpm->find_candidate_packages($p->name, avoided => $state->{rejected});
my $best = join '|', map { $_->id }
grep { $_->fullname ne $p->fullname &&
- $urpm->unsatisfied_requires($db, $state, $_,
- nopromoteepoch => 0,
- name => $n) == 0 }
+ $urpm->unsatisfied_requires($db, $state, $_, name => $n) == 0 }
@{$packages->{$p->name}};
if (length $best) {
push @properties, { required => $best, promote => $n, psel => $pkg };
} else {
#- no package have been found, we may need to remove the package examined unless
- #- there exists a package that provided the unsatisfied requires.
+ #- there exists enough packages that provided the unsatisfied requires.
my @best;
foreach (@l) {
$packages = $urpm->find_candidate_packages($_,
- nopromoteepoch => 0,
+ nopromoteepoch => 1,
avoided => $state->{rejected});
$best = join('|',
map { $_->id }
diff --git a/perl-URPM.spec b/perl-URPM.spec
index 9bcdf8f..1948515 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -1,7 +1,7 @@
%define name perl-URPM
%define real_name URPM
%define version 0.91
-%define release 8mdk
+%define release 9mdk
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -51,6 +51,17 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon Jul 7 2003 François Pons <fpons@mandrakesoft.com> 0.91-9mdk
+- fixed provides from package not examined for looking into
+ unsatisfied requires.
+- fixed handling of promoteepoch (if B requires A and both A and B
+ are new packages, promoteepoch can be activated).
+- updated comments about promoteepoch management (it is touchy
+ enough without adding obfuscation here).
+- fixed (a lot of people should be very happy now) global unsatisfied
+ requires examined, so that it should now be possible to keep a
+ rpmdb with unsatisfied dependencies.
+
* Fri Jul 4 2003 François Pons <fpons@mandrakesoft.com> 0.91-8mdk
- removed handling of promoteepoch as it is specifically obscure
in rpm and make urpmi crazy.