aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-08-12 16:00:02 +0000
committerFrancois Pons <fpons@mandriva.com>2002-08-12 16:00:02 +0000
commit692b5dd63adcdbef64aef9e8b2812c3704335bb2 (patch)
tree95ca7a35d872dc8c1d9c5fd3492b37b0a43e377f
parent4b80be8e2ef75bfa9d9dbe89a3c2575abe041ca1 (diff)
downloadperl-URPM-692b5dd63adcdbef64aef9e8b2812c3704335bb2.tar
perl-URPM-692b5dd63adcdbef64aef9e8b2812c3704335bb2.tar.gz
perl-URPM-692b5dd63adcdbef64aef9e8b2812c3704335bb2.tar.bz2
perl-URPM-692b5dd63adcdbef64aef9e8b2812c3704335bb2.tar.xz
perl-URPM-692b5dd63adcdbef64aef9e8b2812c3704335bb2.zip
0.60-7mdk
-rw-r--r--URPM/Resolve.pm50
-rw-r--r--perl-URPM.spec8
2 files changed, 41 insertions, 17 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 877ac09..8247489 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -559,22 +559,42 @@ sub compute_installed_flags {
#- all installed or upgrade flag.
sub request_packages_to_upgrade {
my ($urpm, $db, $state, $requested, %options) = @_;
- my (%names, %skip, %obsoletes, @obsoleters);
+ my (%provides, %names, %skip, %requested, %obsoletes, @obsoleters);
#- build direct access to best package according to name.
- foreach (@{$urpm->{depslist}}) {
- if ($_->is_arch_compat) {
- my $p = $names{$_->name};
+ foreach my $pkg (@{$urpm->{depslist}}) {
+ if ($pkg->is_arch_compat) {
+ foreach ($pkg->provides) {
+ if (my ($n, $evr) = /^([^\s\[]*)(?:\[\*\])?\[?=+\s*([^\s\]]*)/) {
+ if ($provides{$n}) {
+ foreach ($provides{$n}->provides) {
+ if (my ($pn, $pevr) = /^([^\s\[]*)(?:\[\*\])?\[?=+\s*([^\s\]]*)/) {
+ $pn eq $n or next;
+ if (ranges_overlap("< $evr", "== $pevr")) {
+ $skip{$provides{$n}->name} = undef; #- this package looks like too old ?
+ $provides{$n} = $pkg;
+ }
+ last;
+ }
+ }
+ } else {
+ $provides{$n} = $pkg;
+ }
+ }
+ }
+
+ my $p = $names{$pkg->name};
if ($p) {
- if ($_->compare_pkg($p) > 0) {
- $names{$_->name} = $_;
+ if ($pkg->compare_pkg($p) > 0) {
+ $names{$pkg->name} = $pkg;
}
} else {
- $names{$_->name} = $_;
+ $names{$pkg->name} = $pkg;
}
}
}
+ #- clean direct access, a package in names should have
#- check consistency with obsoletes of eligible package.
#- it is important not to select a package wich obsolete
#- an old one.
@@ -599,15 +619,13 @@ sub request_packages_to_upgrade {
#- first try with package using the same name.
#- this will avoid selecting all packages obsoleting an old one.
if (my $pkg = $names{$p->name}) {
- $pkg->flag_upgrade || $pkg->flag_installed or $pkg->set_flag_upgrade;
- $pkg->set_flag_installed;
- if ($pkg->compare_pkg($p) <= 0) {
- #- this means the package is already installed (or there
- #- is a old version in depslist).
- $pkg->set_flag_upgrade(0);
- #- ignore it now.
- delete $names{$p->name};
+ unless ($pkg->flag_upgrade || $pkg->flag_installed) {
+ $pkg->set_flag_installed; #- there is at least one package installed (whatever its version).
+ $pkg->flag_upgrade and $pkg->set_flag_upgrade($pkg->compare_pkg($p) > 0);
}
+ $pkg->flag_upgrade or delete $names{$p->name};
+ #- keep in mind the package is requested.
+ $pkg->flag_upgrade and $requested{$p->name} = undef;
}
#- check provides of existing package to see if a obsolete
@@ -659,7 +677,7 @@ sub request_packages_to_upgrade {
#- examine all packages potentially selectable.
foreach my $pkg (values %names) {
- $pkg->flag_upgrade and $requested->{$pkg->id} = $options{requested};
+ exists $requested{$pkg->name} and $requested->{$pkg->id} = $options{requested};
}
$requested;
diff --git a/perl-URPM.spec b/perl-URPM.spec
index ff9f7d9..3d62599 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -1,7 +1,7 @@
%define name perl-URPM
%define real_name URPM
%define version 0.60
-%define release 6mdk
+%define release 7mdk
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -48,6 +48,12 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon Aug 12 2002 François Pons <fpons@mandrakesoft.com> 0.60-7mdk
+- fixed bad behaviour of request_packages_to_upgrade if upgrade flag
+ has been computed before.
+- fixed propable old package (according provides) requested by
+ request_packages_to_upgrade.
+
* Mon Aug 12 2002 François Pons <fpons@mandrakesoft.com> 0.60-6mdk
- simplified compute_installed_flags return value (used by DrakX).