aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-08-24 16:14:11 +0000
committerThierry Vignaud <tv@mageia.org>2012-08-24 16:14:11 +0000
commit32c8c1254f461d7776bfc2057f071db450693b02 (patch)
tree86b2f57a8cc6522d92b6a4783a5a21e51de5e245 /Rpmdrake
parent5dbaf97b4b6151ba1f63649bbdd74380ca2e2f57 (diff)
downloadrpmdrake-32c8c1254f461d7776bfc2057f071db450693b02.tar
rpmdrake-32c8c1254f461d7776bfc2057f071db450693b02.tar.gz
rpmdrake-32c8c1254f461d7776bfc2057f071db450693b02.tar.bz2
rpmdrake-32c8c1254f461d7776bfc2057f071db450693b02.tar.xz
rpmdrake-32c8c1254f461d7776bfc2057f071db450693b02.zip
(extract_header) only call costly ->files method once
Diffstat (limited to 'Rpmdrake')
-rw-r--r--Rpmdrake/pkg.pm4
1 files changed, 3 insertions, 1 deletions
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