diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2018-09-13 15:19:16 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2018-09-14 16:24:40 +0200 |
commit | 020f50af145bdee22596dd114f67e424f9c36b99 (patch) | |
tree | eac7c30f5ca710326d419ae46ba1d25ea9103911 /perl-install | |
parent | b89e73e5eeaa5b278be7e3795ce42deb9dc7eead (diff) | |
download | drakx-020f50af145bdee22596dd114f67e424f9c36b99.tar drakx-020f50af145bdee22596dd114f67e424f9c36b99.tar.gz drakx-020f50af145bdee22596dd114f67e424f9c36b99.tar.bz2 drakx-020f50af145bdee22596dd114f67e424f9c36b99.tar.xz drakx-020f50af145bdee22596dd114f67e424f9c36b99.zip |
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
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install/NEWS | 2 | ||||
-rw-r--r-- | perl-install/install/pkgs.pm | 16 |
2 files changed, 18 insertions, 0 deletions
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); |