From 66f0becb1ce7358f2f0355c1a366ceeb2759b662 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 20 Mar 2009 15:50:35 +0000 Subject: (is_package_installed) split it out of _install_raw::close_helper() --- perl-install/install/pkgs.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm index 0f940939b..046b44b09 100644 --- a/perl-install/install/pkgs.pm +++ b/perl-install/install/pkgs.pm @@ -715,6 +715,16 @@ sub _unselect_package { } } +sub is_package_installed { + my ($db, $pkg) = @_; + my $check_installed; + $db->traverse_tag('name', [ $pkg->name ], sub { + my ($p) = @_; + $check_installed ||= $pkg->compare_pkg($p) == 0; + }); + return $check_installed; +} + sub _install_raw { my ($packages, $isUpgrade, $callback, $LOG, $noscripts) = @_; @@ -733,11 +743,7 @@ sub _install_raw { my ($db, $packages, $_type, $id) = @_; &$callback; my $pkg = defined $id && $packages->{depslist}[$id] or return; - my $check_installed; - $db->traverse_tag('name', [ $pkg->name ], sub { - my ($p) = @_; - $check_installed ||= $pkg->compare_pkg($p) == 0; - }); + my $check_installed = is_package_installed($db, $pkg); if ($pkg->name eq 'mdv-rpm-summary' && $check_installed) { install::pkgs::setup_rpm_summary_translations(); } -- cgit v1.2.1