summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-03-20 15:50:35 +0000
committerThierry Vignaud <tv@mandriva.org>2009-03-20 15:50:35 +0000
commit66f0becb1ce7358f2f0355c1a366ceeb2759b662 (patch)
treea5470eff07ad80f451d9ff31bf705b6625f11bb9 /perl-install
parent7fa9e31b3f6985b7bb0fcb8c3334195bc5673fc1 (diff)
downloaddrakx-66f0becb1ce7358f2f0355c1a366ceeb2759b662.tar
drakx-66f0becb1ce7358f2f0355c1a366ceeb2759b662.tar.gz
drakx-66f0becb1ce7358f2f0355c1a366ceeb2759b662.tar.bz2
drakx-66f0becb1ce7358f2f0355c1a366ceeb2759b662.tar.xz
drakx-66f0becb1ce7358f2f0355c1a366ceeb2759b662.zip
(is_package_installed) split it out of _install_raw::close_helper()
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install/pkgs.pm16
1 files 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();
}