aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-09-05 09:51:42 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-09-05 09:51:42 +0000
commitddaaa32238efe6320695b8e7b41b6b29e1f85026 (patch)
tree7bb609089ed29ccea508609d474b72f816598045
parenta37f1fa445149a37615f4955b61dd842c3c42550 (diff)
downloadrpmdrake-ddaaa32238efe6320695b8e7b41b6b29e1f85026.tar
rpmdrake-ddaaa32238efe6320695b8e7b41b6b29e1f85026.tar.gz
rpmdrake-ddaaa32238efe6320695b8e7b41b6b29e1f85026.tar.bz2
rpmdrake-ddaaa32238efe6320695b8e7b41b6b29e1f85026.tar.xz
rpmdrake-ddaaa32238efe6320695b8e7b41b6b29e1f85026.zip
fix garbled UTF8 in "summary" and "description" of pkgs when i18n'ed thx pablo
-rwxr-xr-xrpmdrake21
-rw-r--r--rpmdrake.spec5
2 files changed, 19 insertions, 7 deletions
diff --git a/rpmdrake b/rpmdrake
index 1fd044fb..f6141622 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -169,9 +169,17 @@ sub ctreefy {
join('|', map { translate($_) } split m|/|, $_[0]);
}
-sub beautify_description {
+sub rpm_summary {
+ my ($summary) = @_;
+ c::set_tagged_utf8($summary);
+ $summary;
+}
+
+sub rpm_description {
+ my ($description) = @_;
+ c::set_tagged_utf8($description);
my ($t, $tmp);
- foreach (split "\n", $_[0]) {
+ foreach (split "\n", $description) {
s/^\s*//;
if (/^$/ || /^\s*(-|\*|\+|o)\s/) {
$t || $tmp and $t .= "$tmp\n";
@@ -245,7 +253,7 @@ sub extract_header {
$packer->extract_archive($headersdir, $p->header_filename);
$p->update_header("$headersdir/" . $p->header_filename) or log::l("Warning, could not extract header!"), goto header_non_available;
rm_rf($headersdir);
- add2hash($pkg, { summary => $p->summary, description => beautify_description($p->description) });
+ add2hash($pkg, { summary => rpm_summary($p->summary), description => rpm_description($p->description) });
my $localtime2changelog = sub { scalar(localtime($_[0])) =~ /(.*) \S+ (\d{4})$/ && "$1 $2" };
@$max_info_in_descr and add2hash($pkg, {
files => join("\n", $p->files) || N("(none)"),
@@ -612,7 +620,7 @@ or you already installed all of them."));
[ "\n".N("Summary: "), $tag_tag ], [ "$pkgs->{$key}{summary}\n\n" ],
if_($MODE eq 'update',
[ N("Reason for update: "), $tag_tag ],
- [ beautify_description($descriptions->{$name}{pre})."\n" ]),
+ [ rpm_description($descriptions->{$name}{pre})."\n" ]),
[ N("Description: "), $tag_tag ], [ "$pkgs->{$key}{description}\n" ],
@max_info ];
},
@@ -1216,8 +1224,9 @@ sub get_installed_pkgs {
my $fullname = my_fullname($pkg);
if (!$base{$fullname} || ${$base{$fullname}} != 1) {
#- I need to extract summary and description since they'll be lost when $pkg->pack_header
- $installed_pkgs{$fullname} = { selected => 0, pkg => $pkg, urpm_name => urpm_name($pkg), summary => $pkg->summary,
- description => beautify_description($pkg->description) };
+ $installed_pkgs{$fullname} = { selected => 0, pkg => $pkg, urpm_name => urpm_name($pkg),
+ summary => rpm_summary($pkg->summary),
+ description => rpm_description($pkg->description) };
$base{$fullname} and $installed_pkgs{$fullname}{base} = \${$base{$fullname}};
}
$pkg->pack_header;
diff --git a/rpmdrake.spec b/rpmdrake.spec
index 2cf186f3..f43b8353 100644
--- a/rpmdrake.spec
+++ b/rpmdrake.spec
@@ -8,7 +8,7 @@
%define name rpmdrake
%define version 2.1
-%define release 35mdk
+%define release 36mdk
Name: %{name}
Version: %{version}
@@ -101,6 +101,9 @@ rm -rf $RPM_BUILD_ROOT
%{perl_vendorarch}/*.pm
%changelog
+* Fri Sep 5 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.1-36mdk
+- fix garbled UTF8 in "summary" and "description" of pkgs when i18n'ed
+
* Thu Sep 4 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.1-35mdk
- fix invalid-build-requires libcurl2-devel