aboutsummaryrefslogtreecommitdiffstats
path: root/URPM/Resolve.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2020-03-05 15:53:56 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2020-03-05 18:35:25 +0100
commit674d1c5593bf6a2f036e4f32992f6c73bc0887a4 (patch)
treeb4c69866c0c09653652e549f154438956c81879f /URPM/Resolve.pm
parent1095f57e60c767b72576079308e250b710a1368a (diff)
downloadperl-URPM-674d1c5593bf6a2f036e4f32992f6c73bc0887a4.tar
perl-URPM-674d1c5593bf6a2f036e4f32992f6c73bc0887a4.tar.gz
perl-URPM-674d1c5593bf6a2f036e4f32992f6c73bc0887a4.tar.bz2
perl-URPM-674d1c5593bf6a2f036e4f32992f6c73bc0887a4.tar.xz
perl-URPM-674d1c5593bf6a2f036e4f32992f6c73bc0887a4.zip
add support for reinstall (needs rpm >= 4.12.x)
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r--URPM/Resolve.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 55f5c64..33504b5 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -1210,7 +1210,7 @@ sub resolve_requested__no_recommends_ {
} else {
_set_flag_installed_and_upgrade_if_no_newer($db, $pkg);
- if ($pkg->flag_installed && !$pkg->flag_upgrade && !$urpm->{options}{downgrade}) {
+ if ($pkg->flag_installed && !$pkg->flag_upgrade && !$urpm->{options}{downgrade} && !$urpm->{options}{reinstall}) {
_no_more_recent_installed_and_providing($urpm, $db, $state, $pkg, $dep->{required}) or next;
}
}
@@ -1417,7 +1417,7 @@ sub _unselect_package_deprecated_by_property {
#- remove this package from the list of packages to install,
#- unless urpmi was invoked with --allow-force
#- (in which case rpm could be invoked with --oldpackage)
- if (!$urpm->{options}{'allow-force'} && !$urpm->{options}{downgrade}) {
+ if (!$urpm->{options}{'allow-force'} && !$urpm->{options}{downgrade} && !$urpm->{options}{reinstall}) {
#- since the originally requested packages (or other
#- non-installed ones) could be unselected by the following
#- operation, remember them, to warn the user
@@ -1429,6 +1429,10 @@ sub _unselect_package_deprecated_by_property {
}
} elsif ($satisfied) {
$obsoleted = 1;
+ } elsif ($urpm->{options}{reinstall}) {
+ # So that we do not ask for "The following package has to be removed for others to be upgraded:
+ # foo-V-R (in order to install foo-V-R) (y/N)"
+ return;
}
} elsif ($satisfied) {
$obsoleted = 1;