summaryrefslogtreecommitdiffstats
path: root/perl-install/install/pkgs.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2018-11-21 03:53:02 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2018-11-21 03:55:32 +0100
commit73aa98991a97501bc1e251689865d71ec20298a9 (patch)
treeecb5d860f8b671ea5b17b2f2b39a9f2482d60030 /perl-install/install/pkgs.pm
parentf6fb10dd51fff62d4ff274829f1b33a4cca68f0b (diff)
downloaddrakx-73aa98991a97501bc1e251689865d71ec20298a9.tar
drakx-73aa98991a97501bc1e251689865d71ec20298a9.tar.gz
drakx-73aa98991a97501bc1e251689865d71ec20298a9.tar.bz2
drakx-73aa98991a97501bc1e251689865d71ec20298a9.tar.xz
drakx-73aa98991a97501bc1e251689865d71ec20298a9.zip
remove debug statement
wrongly added with commit 6375ef3a8cd8b1b1e057334ab680c5c701123395 (spot by Martin Whitaker)
Diffstat (limited to 'perl-install/install/pkgs.pm')
-rw-r--r--perl-install/install/pkgs.pm45
1 files changed, 16 insertions, 29 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 87ff120bb..c859fb880 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -842,18 +842,10 @@ 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;
}
@@ -873,21 +865,26 @@ sub _install_raw {
log::l("rpm transactions start");
- my ($is_installing);
+ my ($is_installing, $verify_just_closed);
my $exit_code = urpm::main_loop::run($packages, $packages->{state}, undef, undef, {
- open_helper => sub {
- my ($db, $packages, $type, $id) = @_;
- log::l("OPENING (is_installing=$is_installing) ($db, $packages, $type, $id)\n");
- &$callback;
- },
+ open_helper => $callback,
verify => sub {
- my ($data, $cb_type, $pkg_id, $subtype, $amout, $total) = @_;
- log::l("VERIFY($data, $cb_type, $pkg_id, $subtype, $amout, $total)\n");
+ 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) = @_;
- log::l("CLOSING (is_installing=$is_installing) ($db, $packages, $type, $id)\n");
+ 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";
@@ -901,17 +898,7 @@ sub _install_raw {
} else {
log::l($pkg->name . " not installed, " . URPM::rpmErrorString());
}
- }, 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;
- },
+ }, inst => $callback,
trans => $callback,
# FIXME: implement already_installed_or_not_installable
bad_signature => sub {