From 6375ef3a8cd8b1b1e057334ab680c5c701123395 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 15 Nov 2018 09:35:38 +0100 Subject: sync with kernel 4.1[89] --- perl-install/install/pkgs.pm | 45 ++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'perl-install/install/pkgs.pm') diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm index c859fb880..87ff120bb 100644 --- a/perl-install/install/pkgs.pm +++ b/perl-install/install/pkgs.pm @@ -842,10 +842,18 @@ sub _unselect_package { sub is_package_installed { my ($db, $pkg) = @_; my $check_installed; + my $done; + my $n=$pkg->name; $db->traverse_tag('name', [ $pkg->name ], sub { my ($p) = @_; + $done = 1; $check_installed ||= $pkg->compare_pkg($p) == 0; + log::l(">> ". $pkg->EVR . " vs ". $p->EVR. " --> check_installed=$check_installed\n"); + warn ">> ". $pkg->EVR . " vs ". $p->EVR. " --> check_installed=$check_installed\n"; + }); + my $real = `rpm -q $n`; + log::l("check_installed=0 for $n b/c pkg wasn't found in db VS $real") if !$done; return $check_installed; } @@ -865,26 +873,21 @@ sub _install_raw { log::l("rpm transactions start"); - my ($is_installing, $verify_just_closed); + my ($is_installing); my $exit_code = urpm::main_loop::run($packages, $packages->{state}, undef, undef, { - open_helper => $callback, + open_helper => sub { + my ($db, $packages, $type, $id) = @_; + log::l("OPENING (is_installing=$is_installing) ($db, $packages, $type, $id)\n"); + &$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; - } + my ($data, $cb_type, $pkg_id, $subtype, $amout, $total) = @_; + log::l("VERIFY($data, $cb_type, $pkg_id, $subtype, $amout, $total)\n"); }, close_helper => sub { - my ($db, $packages, $_type, $id) = @_; + my ($db, $packages, $type, $id) = @_; + log::l("CLOSING (is_installing=$is_installing) ($db, $packages, $type, $id)\n"); &$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"; @@ -898,7 +901,17 @@ sub _install_raw { } else { log::l($pkg->name . " not installed, " . URPM::rpmErrorString()); } - }, inst => $callback, + }, inst => sub { + my ($data, $cb_type, $pkg_id, $subtype, $amout, $total) = @_; + log::l("INSTALL($data, $cb_type, $pkg_id, $subtype, $amout, $total)\n"); + #eg: * VERIFY(urpm=HASH(0x35cd608), verify, 17729, progress, 1, 51, ) + if ($subtype eq 'start') { + $is_installing = 1; + } elsif ($subtype eq 'stop') { + $is_installing = 0; + } + &$callback; + }, trans => $callback, # FIXME: implement already_installed_or_not_installable bad_signature => sub { -- cgit v1.2.1