summaryrefslogtreecommitdiffstats
path: root/perl-install/install/pkgs.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2018-11-15 09:35:38 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2018-11-15 09:48:08 +0100
commit6375ef3a8cd8b1b1e057334ab680c5c701123395 (patch)
tree4a5717617df96c233765f9c19d615d4366331b24 /perl-install/install/pkgs.pm
parentb8034977cffb9d67fc81996d29944f592adff9f4 (diff)
downloaddrakx-6375ef3a8cd8b1b1e057334ab680c5c701123395.tar
drakx-6375ef3a8cd8b1b1e057334ab680c5c701123395.tar.gz
drakx-6375ef3a8cd8b1b1e057334ab680c5c701123395.tar.bz2
drakx-6375ef3a8cd8b1b1e057334ab680c5c701123395.tar.xz
drakx-6375ef3a8cd8b1b1e057334ab680c5c701123395.zip
sync with kernel 4.1[89]
Diffstat (limited to 'perl-install/install/pkgs.pm')
-rw-r--r--perl-install/install/pkgs.pm45
1 files changed, 29 insertions, 16 deletions
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 {