From 020f50af145bdee22596dd114f67e424f9c36b99 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 13 Sep 2018 15:19:16 +0200 Subject: fix regression where drakx report pkgs failing to install rationale: since the following commit: https://github.com/rpm-software-management/rpm/commit/5064276cd946183d711430da44b18608af74ebf1 rpmlib opens/closes the pkgs first in order to check them (introduced in rpm-4.14.2, mga#23531) So we must track whether we're verifying or installing the pkgs before checking whether they've been installed successfuly or not --- perl-install/install/NEWS | 2 ++ perl-install/install/pkgs.pm | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'perl-install') diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 759d15cd0..f5afbe7f5 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,5 +1,7 @@ - drakx-in-chroot: o do not run monitor-edid with drakx-in-chroot (timeout) +- fix regression due to rpm-4.14.2 where drakx report pkgs failing to install + (mga#23531) Version 18.0 - 25 August 2018 diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm index 57a7f162f..c859fb880 100644 --- a/perl-install/install/pkgs.pm +++ b/perl-install/install/pkgs.pm @@ -865,11 +865,27 @@ sub _install_raw { log::l("rpm transactions start"); + 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; + } + }, 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"; my $check_installed = is_package_installed($db, $pkg); -- cgit v1.2.1