From e6374fad0353d656d9df81c27765b4429676c04e Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 13 Feb 2008 14:12:32 +0000 Subject: (extract_header,run_rpm) factorize calling ensure_utf8() in run_rpm(), thus enabling to fix UTF-8-ness per-line, thus reducing the number of garbaged accents in changelogs --- Rpmdrake/pkg.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Rpmdrake') diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 9b32f4a4..e667183b 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -94,7 +94,7 @@ sub run_rpm { foreach (qw(LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL)) { local $ENV{$_} = $ENV{$_} . '.UTF-8' if $ENV{$_} && $ENV{$_} !~ /UTF-8/; } - my @l = `@_`; + my @l = map { ensure_utf8($_) } `@_`; wantarray() ? @l : join('', @l); } @@ -115,9 +115,9 @@ sub extract_header { $name =~ s!\.src!!; if ($p->flag_installed && !$p->flag_upgrade) { - my @files = map { chomp_(ensure_utf8($_)) } run_rpm("rpm -ql $name"); + my @files = map { chomp_($_) } run_rpm("rpm -ql $name"); add2hash($pkg, { files => [ @files ? @files : N("(none)") ], - changelog => format_changelog_string($o_installed_version, ensure_utf8(scalar(run_rpm("rpm -q --changelog $name")))) }); + changelog => format_changelog_string($o_installed_version, scalar(run_rpm("rpm -q --changelog $name"))) }); } else { my $medium = pkg2medium($p, $urpm); my ($local_source, %xml_info_pkgs, $bar_id); -- cgit v1.2.1