From 32c8c1254f461d7776bfc2057f071db450693b02 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 24 Aug 2012 16:14:11 +0000 Subject: (extract_header) only call costly ->files method once --- Rpmdrake/pkg.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 796e77e4..6889d5f2 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -158,8 +158,10 @@ sub extract_header { warn "Warning, could not extract header for $name from $medium!"; goto header_non_available; }; + my @files = $p->files; + @files = N("(none)") if !@files; add2hash($pkg, { description => rpm_description($p->description), - files => scalar($p->files) ? [ $p->files ] : [ N("(none)") ], + files => \@files, url => $p->url, changelog => format_changelog_changelogs($o_installed_version, $p->changelogs) }); $p->pack_header; # needed in order to call methods on objects outside ->traverse -- cgit v1.2.1