summaryrefslogtreecommitdiffstats
path: root/perl-install/install
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2020-03-15 12:02:59 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2020-03-15 12:02:59 +0000
commit3458ddbbc94d2a2c5d016e3bac1d14af4b7e8a62 (patch)
treea07d8d66a931a18def61cd5b1ab11a8263e95774 /perl-install/install
parent672d11c1d115d3cc99f3cc51cc9fa3f6ff41bb2d (diff)
downloaddrakx-3458ddbbc94d2a2c5d016e3bac1d14af4b7e8a62.tar
drakx-3458ddbbc94d2a2c5d016e3bac1d14af4b7e8a62.tar.gz
drakx-3458ddbbc94d2a2c5d016e3bac1d14af4b7e8a62.tar.bz2
drakx-3458ddbbc94d2a2c5d016e3bac1d14af4b7e8a62.tar.xz
drakx-3458ddbbc94d2a2c5d016e3bac1d14af4b7e8a62.zip
installer: fix tracking of installed packages (mga#26284)
The installer keeps a record of the packages that have been installed, but was not recording the first package in each transaction. If an affected package was selected in a later step, the installer would attempt to reinstall it. With the latest rpm, this results in a fatal error.
Diffstat (limited to 'perl-install/install')
-rw-r--r--perl-install/install/NEWS1
-rw-r--r--perl-install/install/pkgs.pm26
2 files changed, 11 insertions, 16 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index fbf8b860b..1a4b517ef 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,4 @@
+- fix tracking of installed packages (mga#26284)
- include plugin for supporting Windows 10 NTFS "Compact OS"
- drakx-in-chroot:
o skip disk ESP & BIOS boot partition checks
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 91a57c2cf..2fcd0eccc 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -868,24 +868,14 @@ sub _install_raw {
my ($is_installing, $verify_just_closed);
my $exit_code = urpm::main_loop::run($packages, $packages->{state}, undef, undef, {
- open_helper => $callback,
- verify => sub {
- my ($_data, $_cb_type, $_pkg_id, $subtype, $_amout, $_total, $_pkg_name) = @_;
- if ($subtype eq 'start') {
- $is_installing = 0;
- } elsif ($subtype eq 'stop') {
- $is_installing = 1;
- $verify_just_closed = 1;
- }
- },
+ open_helper => sub {
+ &$callback;
+ $is_installing = 0;
+ },
+ verify => $callback,
close_helper => sub {
my ($db, $packages, $_type, $id) = @_;
&$callback;
- # ignore first close after end of verify:
- if ($is_installing && $verify_just_closed) {
- undef $verify_just_closed;
- return;
- }
return if !$is_installing; # don't check if it's installed if it's being verified
my $pkg = defined $id && $packages->{depslist}[$id] or return;
print $LOG $pkg->fullname . "\n";
@@ -899,7 +889,11 @@ sub _install_raw {
} else {
log::l($pkg->name . " not installed, " . URPM::rpmErrorString());
}
- }, inst => $callback,
+ },
+ inst => sub {
+ &$callback;
+ $is_installing = 1;
+ },
trans => $callback,
# FIXME: implement already_installed_or_not_installable
bad_signature => sub {