aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-02-23 15:25:00 +0000
committerThierry Vignaud <tv@mandriva.org>2009-02-23 15:25:00 +0000
commit3a86fd37711bd6ebce7d4470082702c4a73ba869 (patch)
treec4065092376ccf2920b9f45781bc1d04d1e6c87a
parent2b35cecf47fa383d8ec0f113196a34c63f63183a (diff)
downloadrpmdrake-3a86fd37711bd6ebce7d4470082702c4a73ba869.tar
rpmdrake-3a86fd37711bd6ebce7d4470082702c4a73ba869.tar.gz
rpmdrake-3a86fd37711bd6ebce7d4470082702c4a73ba869.tar.bz2
rpmdrake-3a86fd37711bd6ebce7d4470082702c4a73ba869.tar.xz
rpmdrake-3a86fd37711bd6ebce7d4470082702c4a73ba869.zip
(extract_header,get_installed_packages) further reduce memory usage by not keeping around
descriptions for installed packages ; fetch them on demand (1.2% of resident memory further saved on std x86_64 media config)
-rw-r--r--Rpmdrake/pkg.pm3
1 files changed, 1 insertions, 2 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 37aca9a5..6eb44840 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -91,6 +91,7 @@ sub extract_header {
if ($p->flag_installed && !$p->flag_upgrade) {
my @files = map { chomp_($_) } run_rpm("rpm -ql $name");
add2hash($pkg, { files => [ @files ? @files : N("(none)") ],
+ description => rpm_description(scalar(run_rpm("rpm -q --qf '%{description}' $name"))),
changelog => format_changelog_string($o_installed_version, scalar(run_rpm("rpm -q --changelog $name"))) });
} else {
my $medium = pkg2medium($p, $urpm);
@@ -331,10 +332,8 @@ sub get_installed_packages {
update_pbar($gurpm);
my $fullname = urpm_name($pkg);
return if $fullname =~ /@/;
- #- Extract summary and description since they'll be lost when the header is packed
$all_pkgs->{$fullname} = {
selected => 0, pkg => $pkg, urpm_name => urpm_name($pkg),
- description => rpm_description($pkg->description),
} if !($all_pkgs->{$fullname} && $all_pkgs->{$fullname}{description});
if (my $name = $base{$fullname}) {
$all_pkgs->{$fullname}{base} = \$name;