summaryrefslogtreecommitdiffstats
path: root/perl-install/install/pkgs.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2018-09-13 15:19:16 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2018-09-14 16:24:40 +0200
commit020f50af145bdee22596dd114f67e424f9c36b99 (patch)
treeeac7c30f5ca710326d419ae46ba1d25ea9103911 /perl-install/install/pkgs.pm
parentb89e73e5eeaa5b278be7e3795ce42deb9dc7eead (diff)
downloaddrakx-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/install/pkgs.pm')
-rw-r--r--perl-install/install/pkgs.pm16
1 files changed, 16 insertions, 0 deletions
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);