summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-06-23 15:29:20 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-06-23 15:29:20 +0000
commitc4a9939768874cc640e541c1c212af13a4597c54 (patch)
tree4669fd17439ed0d59555441c4342c24c63677b56
parent63ef4cbd29c6e6fa1d157d7938d264ffa3615e9d (diff)
downloadurpmi-c4a9939768874cc640e541c1c212af13a4597c54.tar
urpmi-c4a9939768874cc640e541c1c212af13a4597c54.tar.gz
urpmi-c4a9939768874cc640e541c1c212af13a4597c54.tar.bz2
urpmi-c4a9939768874cc640e541c1c212af13a4597c54.tar.xz
urpmi-c4a9939768874cc640e541c1c212af13a4597c54.zip
o fix --replacepkgs when a same package appears more than once in urpmi db
-rw-r--r--NEWS1
-rw-r--r--urpm/select.pm4
2 files changed, 2 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 6f36fd67..dbebe7d6 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
- urpmi:
o set connection timeout for rsync as well (Anssi)
+ o fix --replacepkgs when a same package appears more than once in urpmi db
- urpmi.addmedia, urpmi.update:
o fix --no-md5sum (regression introduced in 5.20) (#41237)
diff --git a/urpm/select.pm b/urpm/select.pm
index 608540d6..cf176b52 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -288,12 +288,10 @@ sub select_replacepkgs {
my $db = urpm::db_open_or_die($urpm, $urpm->{root});
foreach my $id (keys %$requested) {
my @pkgs = $urpm->find_candidate_packages_($id);
- if (my @installed = grep { URPM::is_package_installed($db, $_) } @pkgs) {
- foreach my $pkg (@installed) {
+ if (my ($pkg) = grep { URPM::is_package_installed($db, $_) } @pkgs) {
$urpm->{debug_URPM}("selecting replacepkg " . $pkg->fullname) if $urpm->{debug_URPM};
$pkg->set_flag_requested;
$state->{selected}{$pkg->id} = undef;
- }
} else {
$urpm->{fatal}(1, N("found package(s) %s in urpmi db, but none are installed", join(', ', map { scalar($_->fullname) } @pkgs)));
}