diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-02-06 14:05:53 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-02-06 14:05:53 +0000 |
commit | 04c78941c004b63807cfd18b0566bf4dd1200180 (patch) | |
tree | d10a9bfde0f6d72bfd1478137d4c25ed5bd5943e /Rpmdrake/pkg.pm | |
parent | 1b8061fbbe7bcbfea0402cf1dbec1792d2d62904 (diff) | |
download | rpmdrake-04c78941c004b63807cfd18b0566bf4dd1200180.tar rpmdrake-04c78941c004b63807cfd18b0566bf4dd1200180.tar.gz rpmdrake-04c78941c004b63807cfd18b0566bf4dd1200180.tar.bz2 rpmdrake-04c78941c004b63807cfd18b0566bf4dd1200180.tar.xz rpmdrake-04c78941c004b63807cfd18b0566bf4dd1200180.zip |
(build_expander,extract_header,format_pkg_simplifiedinfo)
- stop downloading & parsing the XML meta data on selecting a package (side
effect of urpmi-5.x)
- download & parse the needed XML meta data on demand (aka only
download & parse the needed ones and not all of them)
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rw-r--r-- | Rpmdrake/pkg.pm | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 66c9dae2..9808974d 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -92,7 +92,7 @@ sub run_rpm { our $spacing = " "; sub extract_header { - my ($pkg, $urpm) = @_; + my ($pkg, $urpm, $xml_info) = @_; my $chg_prepro = sub { #- preprocess changelog for faster TextView insert reaction [ map { [ "$spacing$_\n", if_(/^\*/, { 'weight' => Gtk2::Pango->PANGO_WEIGHT_BOLD }) ] } split("\n", $_[0]) ]; @@ -112,7 +112,6 @@ sub extract_header { $local_source = "$dir/" . $p->filename; $urpm->{log}("getting information from rpms from $dir"); } else { - foreach my $xml_info ('info', 'files', 'changelog') { my $gurpm = Rpmdrake::gurpm->new(N("Please wait"), transient => $::main_window); if (my $xml_info_file = urpm::media::any_xml_info($urpm, $medium, $xml_info, undef, sub { download_callback($gurpm, @_) @@ -131,7 +130,6 @@ sub extract_header { $urpm->{error}(N("No xml info for medium \"%s\", unable to return any result for package %s", $medium->{name}, $name)); } } - } } #- even if non-root, search for a header in the global cachedir @@ -148,13 +146,17 @@ sub extract_header { [ $p->changelog_name ], [ $p->changelog_text ], [ $p->changelog_time ])) }); $p->pack_header; # needed in order to call methods on objects outside ->traverse } elsif ($xml_info_pkgs{$name}) { - add2hash($pkg, { description => rpm_description($xml_info_pkgs{$name}{description}) }); - add2hash($pkg, { - files => [ $xml_info_pkgs{$name}{files} || N("(none)") ], - changelog => $chg_prepro->(join("\n", map { - "* " . localtime2changelog($_->{time}) . " $_->{name}\n$_->{text}\n\n"; - } @{$xml_info_pkgs{$name}{changelogs}})) - }); + if ($xml_info eq 'info') { + add2hash($pkg, { description => rpm_description($xml_info_pkgs{$name}{description}) }); + } elsif ($xml_info eq 'files') { + add2hash($pkg, { files => [ $xml_info_pkgs{$name}{files} || N("(none)") ] }); + } elsif ($xml_info eq 'changelog') { + add2hash($pkg, { + changelog => $chg_prepro->(join("\n", map { + "* " . localtime2changelog($_->{time}) . " $_->{name}\n$_->{text}\n\n"; + } @{$xml_info_pkgs{$name}{changelogs}})) + }); + } $p->pack_header; # needed in order to call methods on objects outside ->traverse } else { goto header_non_available; |