diff options
author | Francois Pons <fpons@mandriva.com> | 2001-09-11 15:49:37 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-09-11 15:49:37 +0000 |
commit | 2797a208fbbc4ceda03f76cfafec93eea02fd683 (patch) | |
tree | 93858c353ff4bb415f31a8f2c774f9c37a0a27c7 | |
parent | 04153f0494afa9d48b37e764f0628776577c6a0e (diff) | |
download | urpmi-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.
-rw-r--r-- | urpm.pm | 17 | ||||
-rwxr-xr-x | urpmi | 2 | ||||
-rw-r--r-- | urpmi.spec | 5 | ||||
-rwxr-xr-x | urpmq | 2 |
4 files changed, 19 insertions, 7 deletions
@@ -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; } @@ -216,7 +216,7 @@ if ($auto_select) { } if ($minimal) { - $urpm->read_provides; + $use_provides || @files or $urpm->read_provides; $update or $urpm->read_config; $urpm->filter_minimal_packages_to_upgrade(\%packages, $ask_choice); } else { @@ -2,7 +2,7 @@ Name: urpmi Version: 1.7 -Release: 9mdk +Release: 10mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate @@ -114,6 +114,9 @@ rm -f /var/lib/urpmi/depslist %changelog +* Tue Sep 11 2001 François Pons <fpons@mandrakesoft.com> 1.7-10mdk +- fixed error about urpmi saying package already installed. + * Mon Sep 10 2001 François Pons <fpons@mandrakesoft.com> 1.7-9mdk - moved depslist computation out of loop of reading. @@ -135,7 +135,7 @@ if ($query->{auto_select}) { #- filter to add in packages selected required packages. if ($query->{minimal}) { - $urpm->read_provides; + $query->{use_provides} || @files or $urpm->read_provides; $query->{update} or $urpm->read_config(nocheck_access => 1); $urpm->filter_minimal_packages_to_upgrade(\%packages, undef); } else { |