summaryrefslogtreecommitdiffstats
path: root/urpm/select.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-06-02 06:37:59 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-06-02 06:37:59 +0000
commit8f0e0f2a2fcc77de1dcf29e1aee7b83d1407db3e (patch)
treea548b4fad063583fa47004d29fe46e9faccd796f /urpm/select.pm
parent8692b2fc28950c1dabd07a8ded38e747a9a83a9b (diff)
downloadurpmi-8f0e0f2a2fcc77de1dcf29e1aee7b83d1407db3e.tar
urpmi-8f0e0f2a2fcc77de1dcf29e1aee7b83d1407db3e.tar.gz
urpmi-8f0e0f2a2fcc77de1dcf29e1aee7b83d1407db3e.tar.bz2
urpmi-8f0e0f2a2fcc77de1dcf29e1aee7b83d1407db3e.tar.xz
urpmi-8f0e0f2a2fcc77de1dcf29e1aee7b83d1407db3e.zip
- urpmi
o fix --replacepkgs when a package appears more than once in urpmi db (#40893) (need perl-URPM 3.14)
Diffstat (limited to 'urpm/select.pm')
-rw-r--r--urpm/select.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/urpm/select.pm b/urpm/select.pm
index c67f4edc..608540d6 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -282,6 +282,24 @@ sub resolve_dependencies {
$need_restart;
}
+sub select_replacepkgs {
+ my ($urpm, $state, $requested) = @_;
+
+ 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) {
+ $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)));
+ }
+ }
+}
+
sub _priority_upgrade_pkgs {
my ($urpm, $priority_upgrade_string) = @_;