summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm23
-rw-r--r--urpmi.spec5
2 files changed, 16 insertions, 12 deletions
diff --git a/urpm.pm b/urpm.pm
index f8da5b99..e2663714 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -923,10 +923,12 @@ sub search_packages {
my $best;
foreach (@$_) {
if ($best) {
- my $cmp_version = rpmtools::version_compare($_->{info}{version}, $best->{info}{version});
+ my $cmp_version = ($_->{info}{serial} == $best->{info}{serial} &&
+ rpmtools::version_compare($_->{info}{version}, $best->{info}{version}));
my $cmp_release = $cmp_version == 0 && version_compare($_->{info}{release}, $best->{info}{release});
if ($_->{info}{serial} > $best->{info}{serial} || $cmp_version > 0 || $cmp_release > 0 ||
- $cmp_version == 0 && $cmp_release == 0 && better_arch($_->{info}{arch}, $best->{info}{arch})) {
+ ($_->{info}{serial} == $best->{info}{serial} && $cmp_version == 0 && $cmp_release == 0 &&
+ better_arch($_->{info}{arch}, $best->{info}{arch}))) {
$best = $_;
}
} else {
@@ -1026,8 +1028,8 @@ sub filter_packages_to_upgrade {
foreach (@packages_installed) {
my $pkg = $urpm->{params}{info}{$_->{name}}; $pkg or next; #- TODO error
my $cmp = rpmtools::version_compare($pkg->{version}, $_->{version});
- $installed{$pkg->{id}} = !($pkg->{serial} > $_->{serial} ||
- $cmp > 0 || $cmp == 0 && rpmtools::version_compare($pkg->{release}, $_->{release}) > 0)
+ $installed{$pkg->{id}} = !($pkg->{serial} > $_->{serial} || $pkg->{serial} == $_->{serial} &&
+ ($cmp > 0 || $cmp == 0 && rpmtools::version_compare($pkg->{release}, $_->{release}) > 0))
and delete $packages->{$pkg->{id}};
}
}
@@ -1057,8 +1059,8 @@ sub filter_packages_to_upgrade {
my $pkg = $urpm->{params}{info}{$_->{name}}; $pkg or next; #- TODO error
exists $closures{$pkg->{id}} or next;
my $cmp = rpmtools::version_compare($pkg->{version}, $_->{version});
- $installed{$pkg->{id}} = !($pkg->{serial} > $_->{serial} ||
- $cmp > 0 || $cmp == 0 && rpmtools::version_compare($pkg->{release}, $_->{release}) > 0)
+ $installed{$pkg->{id}} = !($pkg->{serial} > $_->{serial} || $pkg->{serial} == $_->{serial} &&
+ ($cmp > 0 || $cmp == 0 && rpmtools::version_compare($pkg->{release}, $_->{release}) > 0))
and delete $packages->{$pkg->{id}};
}
@@ -1279,8 +1281,7 @@ sub filter_minimal_packages_to_upgrade {
[ qw(name version release serial) ], sub {
my ($p) = @_;
my $cmp = rpmtools::version_compare($pkg->{version}, $p->{version});
- $installed{$pkg->{id}} ||= !($pkg->{serial} > $p->{serial} ||
- $cmp > 0 || $cmp == 0 && rpmtools::version_compare($pkg->{release}, $p->{release}) > 0)
+ $installed{$pkg->{id}} ||= !($pkg->{serial} > $p->{serial} || $pkg->{serial} == $p->{serial} && ($cmp > 0 || $cmp == 0 && rpmtools::version_compare($pkg->{release}, $p->{release}) > 0))
});
$installed{$pkg->{id}} and delete $packages->{$pkg->{id}};
if (exists $packages->{$pkg->{id}} || $installed{$pkg->{id}}) {
@@ -1611,9 +1612,9 @@ sub select_packages_to_upgrade {
if ($pkg) {
my $version_cmp = rpmtools::version_compare($p->{version}, $pkg->{version});
- if ($p->{serial} > $pkg->{serial} ||
- $version_cmp > 0 ||
- $version_cmp == 0 && rpmtools::version_compare($p->{release}, $pkg->{release}) >= 0) {
+ if ($p->{serial} > $pkg->{serial} || $p->{serial} == $pkg->{serial} &&
+ ($version_cmp > 0 ||
+ $version_cmp == 0 && rpmtools::version_compare($p->{release}, $pkg->{release}) >= 0)) {
if ($otherPackage && $version_cmp <= 0) {
$toRemove{$otherPackage} = 0;
$pkg->{selected} = 1;
diff --git a/urpmi.spec b/urpmi.spec
index 25f5db34..02aaf289 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 1.6
-Release: 5mdk
+Release: 6mdk
License: GPL
Source0: %{name}.tar.bz2
Summary: User mode rpm install
@@ -106,6 +106,9 @@ rm -f /var/lib/urpmi/depslist
%changelog
+* Wed Jun 27 2001 François Pons <fpons@mandrakesoft.com> 1.6-6mdk
+- fix problem interpreting serial.
+
* Wed Jun 27 2001 François Pons <fpons@mandrakesoft.com> 1.6-5mdk
- take care of epoch (serial) for version comparison.