From 3a86fd37711bd6ebce7d4470082702c4a73ba869 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 23 Feb 2009 15:25:00 +0000 Subject: (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) --- Rpmdrake/pkg.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Rpmdrake/pkg.pm') 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; -- cgit v1.2.1