aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-06-17 15:35:51 +0000
committerFrancois Pons <fpons@mandriva.com>2003-06-17 15:35:51 +0000
commit6cf39e1513cb12cbf071c6ad86fa47cbf86500bc (patch)
treef0e4eb3252b51e6a7978fd501913c31c381863ff
parent4882262f5c9b4cccc0e3a4727da776b1ce7fceae (diff)
downloadperl-URPM-6cf39e1513cb12cbf071c6ad86fa47cbf86500bc.tar
perl-URPM-6cf39e1513cb12cbf071c6ad86fa47cbf86500bc.tar.gz
perl-URPM-6cf39e1513cb12cbf071c6ad86fa47cbf86500bc.tar.bz2
perl-URPM-6cf39e1513cb12cbf071c6ad86fa47cbf86500bc.tar.xz
perl-URPM-6cf39e1513cb12cbf071c6ad86fa47cbf86500bc.zip
fixed 0.91-2mdk
-rw-r--r--URPM.xs7
-rw-r--r--URPM/Resolve.pm29
-rw-r--r--perl-URPM.spec4
3 files changed, 26 insertions, 14 deletions
diff --git a/URPM.xs b/URPM.xs
index 349fad6..8f48b1b 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -2752,9 +2752,10 @@ Urpm_read_config_files()
read_config_files(1); /* force re-read of configuration files */
int
-Urpm_ranges_overlap(a, b)
+Urpm_ranges_overlap(a, b, b_nopromote=0)
char *a
char *b
+ int b_nopromote
PREINIT:
char *sa = a, *sb = b;
int aflags = 0, bflags = 0;
@@ -2817,8 +2818,10 @@ Urpm_ranges_overlap(a, b)
/* now compare epoch */
if (ea && eb)
sense = rpmvercmp(*ea ? ea : "0", *eb ? eb : "0");
+#ifdef RPM_42
else if (ea && *ea && atol(ea) > 0)
- sense = PROMOTE_EPOCH_SENSE;
+ sense = b_nopromote ? 1 : 0;
+#endif
else if (eb && *eb && atol(eb) > 0)
sense = -1;
/* now compare version and release if epoch has not been enough */
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 7f1d74e..b960982 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -5,7 +5,7 @@ use strict;
#- find candidates packages from a require string (or id),
#- take care of direct choices using | sepatator.
sub find_candidate_packages {
- my ($urpm, $dep, $avoided) = @_;
+ my ($urpm, $dep, %options) = @_;
my %packages;
foreach (split '\|', $dep) {
@@ -13,19 +13,19 @@ sub find_candidate_packages {
my $pkg = $urpm->{depslist}[$_];
$pkg->flag_skip and next;
$pkg->arch eq 'src' || $pkg->is_arch_compat or next;
- $avoided && exists $avoided->{$pkg->fullname} and next;
+ $options{avoided} && exists $options{avoided}{$pkg->fullname} and next;
push @{$packages{$pkg->name}}, $pkg;
} elsif (my ($property, $name) = /^(([^\s\[]*).*)/) {
foreach (keys %{$urpm->{provides}{$name} || {}}) {
my $pkg = $urpm->{depslist}[$_];
$pkg->flag_skip and next;
$pkg->is_arch_compat or next;
- $avoided && exists $avoided->{$pkg->fullname} and next;
+ $options{avoided} && exists $options{avoided}{$pkg->fullname} and next;
#- check if at least one provide of the package overlap the property.
my $satisfied = !$urpm->{provides}{$name}{$_};
unless ($satisfied) {
foreach ($pkg->provides) {
- ranges_overlap($_, $property) and ++$satisfied, last;
+ ranges_overlap($_, $property, $options{nopromoteepoch}) and ++$satisfied, last;
}
}
$satisfied and push @{$packages{$pkg->name}}, $pkg;
@@ -163,7 +163,7 @@ sub unsatisfied_requires {
if ($urpm->{provides}{$n}{$_}) {
#- sense information are used, this means we have to examine carrefully the provides.
foreach ($p->provides) {
- ranges_overlap($_, $dep) and next REQUIRES;
+ ranges_overlap($_, $dep, $options{nopromoteepoch}) and next REQUIRES;
}
} else {
next REQUIRES;
@@ -187,7 +187,7 @@ sub unsatisfied_requires {
if (my ($pn, $ps) = /^([^\s\[]*)(?:\[\*\])?\[?([^\s\]]*\s*[^\s\]]*)/) {
$ps or $state->{cached_installed}{$pn}{$p->fullname} = undef;
$pn eq $n or next;
- ranges_overlap($ps, $s) and ++$satisfied;
+ ranges_overlap($ps, $s, $options{nopromoteepoch}) and ++$satisfied;
}
}
});
@@ -196,6 +196,7 @@ sub unsatisfied_requires {
$satisfied or $properties{$dep} = undef;
}
}
+
keys %properties;
}
@@ -495,12 +496,16 @@ 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)) {
+ if (my @l = $urpm->unsatisfied_requires($db, $state, $p, nopromoteepoch => 1)) {
#- 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, $state->{rejected});
+ my $packages = $urpm->find_candidate_packages($p->name,
+ nopromoteepoch => 1,
+ avoided => $state->{rejected});
my $best = join '|', map { $_->id }
- grep { $urpm->unsatisfied_requires($db, $state, $_, name => $n) == 0 }
+ grep { $urpm->unsatisfied_requires($db, $state, $_,
+ nopromoteepoch => 1,
+ name => $n) == 0 }
@{$packages->{$p->name}};
if (length $best) {
@@ -510,7 +515,9 @@ sub resolve_requested {
#- there exists a package that provided the unsatisfied requires.
my @best;
foreach (@l) {
- $packages = $urpm->find_candidate_packages($_, $state->{rejected});
+ $packages = $urpm->find_candidate_packages($_,
+ nopromoteepoch => 1,
+ avoided => $state->{rejected});
$best = join('|', map { $_->id } map { @{$_ || []} } values %$packages);
$best and push @best, $best;
}
@@ -563,7 +570,7 @@ sub resolve_requested {
#- version will be ok, else ask to remove the old.
my $need_deps = $p->name . " > " . ($p->epoch ? $p->epoch.":" : "") .
$p->version . "-" . $p->release;
- my $packages = $urpm->find_candidate_packages($need_deps, $state->{rejected});
+ my $packages = $urpm->find_candidate_packages($need_deps, avoided => $state->{rejected});
my $best = join '|', map { $_->id }
grep { ! grep { ranges_overlap($_, $property) } $_->provides }
@{$packages->{$p->name}};
diff --git a/perl-URPM.spec b/perl-URPM.spec
index cc2ad91..5c79d2c 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -52,7 +52,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Tue Jun 17 2003 François Pons <fpons@mandrakesoft.com> 0.91-2mdk
-- fixed promotion of epoch to be rpm 4.2 compliant.
+- fixed promotion of epoch to be rpm 4.2 compliant :
+ - added promotion boolean to URPM::ranges_overlap.
+ - changed URPM::find_candidate_packages interface.
* Mon Jun 16 2003 François Pons <fpons@mandrakesoft.com> 0.91-1mdk
- added transaction set methods.