aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-03-10 09:02:05 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-03-10 09:02:05 +0000
commit2fdab26fcb69e38480b97d9c223fd09de57e33e9 (patch)
tree317c441a1fcb062ecbec0854a68b157e5cb8e972
parent77d255230a1fa29ab11d5d76eb35854c63fd8410 (diff)
downloadrpmdrake-2fdab26fcb69e38480b97d9c223fd09de57e33e9.tar
rpmdrake-2fdab26fcb69e38480b97d9c223fd09de57e33e9.tar.gz
rpmdrake-2fdab26fcb69e38480b97d9c223fd09de57e33e9.tar.bz2
rpmdrake-2fdab26fcb69e38480b97d9c223fd09de57e33e9.tar.xz
rpmdrake-2fdab26fcb69e38480b97d9c223fd09de57e33e9.zip
(extract_header) add simple synthesis parser so that we've a summary
fields for updates (filling it with "not availlable" whereas we already have reason, description and the like looks bad)
-rwxr-xr-xrpmdrake19
1 files changed, 16 insertions, 3 deletions
diff --git a/rpmdrake b/rpmdrake
index 5ad18656..74de3906 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -249,9 +249,9 @@ sub extract_header {
#- preprocess changelog for faster TextView insert reaction
[ map { [ "$_\n", if_(/^\*/, { 'weight' => Gtk2::Pango->PANGO_WEIGHT_BOLD }) ] } split("\n", $_[0]) ]
};
+ my $name = my_fullname($pkg->{pkg});
if ($MODE eq 'remove') {
@$max_info_in_descr or return;
- my $name = my_fullname($pkg->{pkg});
add2hash($pkg, { files => [ split /\n/, chomp_(scalar(`rpm -ql $name`)) || N("(none)") ],
changelog => $chg_prepro->(scalar(`LC_ALL=C rpm -q --changelog $name`)) });
} else {
@@ -274,8 +274,21 @@ sub extract_header {
[ $p->changelog_name ], [ $p->changelog_text ], [ $p->changelog_time ])) });
$p->pack_header;
} else {
- header_non_available:
- add2hash($pkg, { summary => N("(Not available)"), description => undef });
+ my $synth = "$urpm->{statedir}/synthesis.$medium->{hdlist}";
+ if (-r $synth) {
+ require run_program;
+ my $found;
+ foreach (run_program::get_stdout("zcat $synth")) {
+ if (!$found && /^\@info\@(.*)/) {
+ $found = 1 if $1 =~ $name;
+ } elsif ($found && /^\@summary\@(.*)/) {
+ add2hash($pkg, { summary => $1, description => undef });
+ }
+ }
+ } else {
+ header_non_available:
+ add2hash($pkg, { summary => N("(Not available)"), description => undef });
+ }
}
}
}