From 2292feb7bc25dafe8794b2cde71c733b28ab07a2 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 21 Sep 2012 16:15:57 +0000 Subject: (extract_header) only call costly ->files method once (backported from trunk) --- Rpmdrake/pkg.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Rpmdrake/pkg.pm') diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index ee7e78a7..11c97b1e 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