summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-09-11 15:49:37 +0000
committerFrancois Pons <fpons@mandriva.com>2001-09-11 15:49:37 +0000
commit2797a208fbbc4ceda03f76cfafec93eea02fd683 (patch)
tree93858c353ff4bb415f31a8f2c774f9c37a0a27c7 /urpm.pm
parent04153f0494afa9d48b37e764f0628776577c6a0e (diff)
downloadurpmi-2797a208fbbc4ceda03f76cfafec93eea02fd683.tar
urpmi-2797a208fbbc4ceda03f76cfafec93eea02fd683.tar.gz
urpmi-2797a208fbbc4ceda03f76cfafec93eea02fd683.tar.bz2
urpmi-2797a208fbbc4ceda03f76cfafec93eea02fd683.tar.xz
urpmi-2797a208fbbc4ceda03f76cfafec93eea02fd683.zip
fixed error about urpmi saying package already installed.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/urpm.pm b/urpm.pm
index d6fe6b84..8a97250e 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1296,6 +1296,7 @@ sub filter_minimal_packages_to_upgrade {
#- choices for which all package in the choices are taken and their dependencies.
#- allow iteration over a modifying list.
while (defined($id = shift @packages)) {
+ print STDERR "examining $id\n";
if (ref $id) {
#- at this point we have almost only choices to resolves.
#- but we have to check if one package here is already selected
@@ -1313,7 +1314,9 @@ sub filter_minimal_packages_to_upgrade {
}
}
my $pkg = $urpm->{params}{depslist}[$id];
+ print STDERR "examining $id as $pkg->{name}-$pkg->{version}-$pkg->{release}.$pkg->{arch} and $pkg->{source}\n";
defined $pkg->{id} or next; #- id has been removed for package that only exists on some arch.
+ print STDERR "accepting $id\n";
#- search for package that will be upgraded, and check the difference
#- of provides to see if something will be altered and need to be upgraded.
@@ -1394,18 +1397,24 @@ sub filter_minimal_packages_to_upgrade {
$pkg = $best[0]; #- keep already requested packages.
}
push @choices, $pkg;
+
rpmtools::db_traverse_tag($db,
'name', [ $_ ],
[ qw(name version release serial) ], sub {
my ($p) = @_;
my $cmp = rpmtools::version_compare($pkg->{version}, $p->{version});
- $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}} ||= !($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}}) {
+ if ($installed{$pkg->{id}}) {
+ @choices = @upgradable_choices = ();
+ delete $installed{$pkg->{id}};
+ next;
+ }
+ #$installed{$pkg->{id}} and delete $packages->{$pkg->{id}};
+ if (exists $packages->{$pkg->{id}}) {
#- the package is already selected, or installed with a better version and release.
@choices = @upgradable_choices = ();
- last;
+ next;
}
exists $installed{$pkg->{id}} and push @upgradable_choices, $pkg;
}