summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2020-03-05 15:48:37 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2020-03-05 18:41:31 +0100
commit454c11f17a6955ff6d8601880fc42fc498f7343b (patch)
tree63c71e89db353684fdc90aaa0882559cd11d3308
parentbfc4d3f45be2e1857b712710dd8cb01a7cbfebb8 (diff)
downloadurpmi-454c11f17a6955ff6d8601880fc42fc498f7343b.tar
urpmi-454c11f17a6955ff6d8601880fc42fc498f7343b.tar.gz
urpmi-454c11f17a6955ff6d8601880fc42fc498f7343b.tar.bz2
urpmi-454c11f17a6955ff6d8601880fc42fc498f7343b.tar.xz
urpmi-454c11f17a6955ff6d8601880fc42fc498f7343b.zip
add support for --reinstall
Needs perl-URPM-5.25 (it won't work with rpm < 4.12.x)
-rwxr-xr-xMakefile.PL2
-rw-r--r--NEWS2
-rw-r--r--urpm/args.pm1
-rw-r--r--urpm/install.pm3
-rwxr-xr-xurpmi2
5 files changed, 7 insertions, 3 deletions
diff --git a/Makefile.PL b/Makefile.PL
index 9c3dbc96..ec19155e 100755
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -152,7 +152,7 @@ WriteMakefile(
'MDV::Distribconf' => '4.100',
'Net::LDAP' => '0',
'Time::ZoneInfo' => '0',
- 'URPM' => 'v5.16',
+ 'URPM' => 'v5.25',
'XML::LibXML' => '0',
'XML::LibXML::Reader' => '0',
},
diff --git a/NEWS b/NEWS
index 712e8d43..a88c040d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- urpmi:
+ o add support for --reinstall
- urpmq:
o display epoch when using -i (mga#25735)
- cpan_testers:
diff --git a/urpm/args.pm b/urpm/args.pm
index 7207a069..26c07f0b 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -99,6 +99,7 @@ my %options_spec = (
$options{buildrequires} = 1 },
'buildrequires' => \$options{buildrequires},
'install-src' => \$::install_src,
+ reinstall => sub { $urpm->{options}{reinstall} = 1 },
clean => sub { $::clean = 1; $::noclean = 0 },
noclean => sub {
$::clean = $urpm->{options}{'pre-clean'} = $urpm->{options}{'post-clean'} = 0;
diff --git a/urpm/install.pm b/urpm/install.pm
index 68f75a2c..e0d22441 100644
--- a/urpm/install.pm
+++ b/urpm/install.pm
@@ -230,7 +230,8 @@ sub _schedule_packages {
($true_rpm, $true_pkg) = _apply_delta_rpm($urpm, $mode->{$_}, $mode, $pkg);
push @produced_deltas, ($mode->{$_} = $true_rpm); #- fix path
}
- if ($trans->add($true_pkg || $pkg, update => $update,
+ if ($urpm->{options}{reinstall} ? $trans->addReinstall($true_pkg || $pkg) :
+ $trans->add($true_pkg || $pkg, update => $update,
$options{excludepath} ? (excludepath => [ split /,/, $options{excludepath} ]) : ())) {
$urpm->{debug} and $urpm->{debug}(
sprintf('trans: scheduling %s of %s (id=%d, file=%s)',
diff --git a/urpmi b/urpmi
index e09afd81..3bbbcc0a 100755
--- a/urpmi
+++ b/urpmi
@@ -583,7 +583,7 @@ if (@to_install && $options{auto_orphans}) {
#- - this also takes care of removing packages from
#- installed-through-deps if the package was first installed as a
#- dep of another package, then removed and then explicitly installed
-if (!$urpm->{options}{downgrade}) {
+if (!$urpm->{options}{downgrade} && !$urpm->{options}{reinstall}) {
urpm::orphans::mark_as_requested($urpm, $state, $test);
}