aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-02-06 14:01:24 +0000
committerThierry Vignaud <tv@mandriva.org>2008-02-06 14:01:24 +0000
commitb4c69ad18d625e098466af8d0d0e2a5c82270605 (patch)
treef6617facd19c4d6f8bb2d46a4570aeb982b6bc49
parentd082822f627d9737b55202a0b835a5c70792e5c9 (diff)
downloadrpmdrake-b4c69ad18d625e098466af8d0d0e2a5c82270605.tar
rpmdrake-b4c69ad18d625e098466af8d0d0e2a5c82270605.tar.gz
rpmdrake-b4c69ad18d625e098466af8d0d0e2a5c82270605.tar.bz2
rpmdrake-b4c69ad18d625e098466af8d0d0e2a5c82270605.tar.xz
rpmdrake-b4c69ad18d625e098466af8d0d0e2a5c82270605.zip
(extract_header) simplify
-rw-r--r--Rpmdrake/pkg.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index e1d35d26..b94a438d 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -97,15 +97,16 @@ sub extract_header {
#- preprocess changelog for faster TextView insert reaction
[ map { [ "$spacing$_\n", if_(/^\*/, { 'weight' => Gtk2::Pango->PANGO_WEIGHT_BOLD }) ] } split("\n", $_[0]) ];
};
- my $name = urpm_name($pkg->{pkg});
+ my $p = $pkg->{pkg};
+ my $name = urpm_name($p);
# fix extracting info for SRPMS and RPM GPG keys:
$name =~ s!\.src!!;
- if ($pkg->{pkg}->flag_installed && !$pkg->{pkg}->flag_upgrade) {
+ if ($p->flag_installed && !$p->flag_upgrade) {
add2hash($pkg, { files => [ split /\n/, chomp_(to_utf8(scalar(run_rpm("rpm -ql $name")))) || N("(none)") ],
changelog => $chg_prepro->(to_utf8(scalar(run_rpm("rpm -q --changelog $name")))) });
} else {
- my ($p, $medium) = ($pkg->{pkg}, pkg2medium($pkg->{pkg}, $urpm));
+ my $medium = pkg2medium($p, $urpm);
my ($local_source, %xml_info_pkgs);
if (my $dir = urpm::file_from_local_url($medium->{url})) {
$local_source = "$dir/" . $p->header_filename;
@@ -134,7 +135,7 @@ sub extract_header {
}
#- even if non-root, search for a header in the global cachedir
- my $file = $local_source || "$urpm->{cachedir}/headers/" . $pkg->{pkg}->header_filename;
+ my $file = $local_source || "$urpm->{cachedir}/headers/" . $p->header_filename;
if (-s $file) {
$p->update_header($file) or do {
warn "Warning, could not extract header for $name from $medium!";