summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-06-27 15:18:21 +0000
committerFrancois Pons <fpons@mandriva.com>2001-06-27 15:18:21 +0000
commita9e532cd4c8f29cf2a12e2caa64ee543ecb706ca (patch)
tree97dd9e103cd861d59ccd30872d6b00de5369887a
parent7f586362135c25d85b53845232b75f2258a5a55d (diff)
downloadurpmi-a9e532cd4c8f29cf2a12e2caa64ee543ecb706ca.tar
urpmi-a9e532cd4c8f29cf2a12e2caa64ee543ecb706ca.tar.gz
urpmi-a9e532cd4c8f29cf2a12e2caa64ee543ecb706ca.tar.bz2
urpmi-a9e532cd4c8f29cf2a12e2caa64ee543ecb706ca.tar.xz
urpmi-a9e532cd4c8f29cf2a12e2caa64ee543ecb706ca.zip
*** empty log message ***
-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.