aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-10-01 13:30:52 +0000
committerThierry Vignaud <tv@mandriva.org>2009-10-01 13:30:52 +0000
commit940ff3a1bb74e23a2187ec8b6e53d1159576606f (patch)
tree91b2b75cc737a26937435f0cb9c0cbb0890c4c0e
parenta185be59cf37f0fbd2c7855a84bddf4b72d2ce0b (diff)
downloadrpmdrake-940ff3a1bb74e23a2187ec8b6e53d1159576606f.tar
rpmdrake-940ff3a1bb74e23a2187ec8b6e53d1159576606f.tar.gz
rpmdrake-940ff3a1bb74e23a2187ec8b6e53d1159576606f.tar.bz2
rpmdrake-940ff3a1bb74e23a2187ec8b6e53d1159576606f.tar.xz
rpmdrake-940ff3a1bb74e23a2187ec8b6e53d1159576606f.zip
(inspect) fix encoding of diff output (#52994)
(inspired from Rpmdrake::run_rpm which we cannot reuse since run_program::get_stdout() ignores output when return value is not 0, which can be 0 or 1 with diff depending whether files are identical or not)
-rw-r--r--NEWS3
-rw-r--r--Rpmdrake/rpmnew.pm6
2 files changed, 8 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index a0ed9e6f..8dc8868d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- rpmdrake
+ o fix encoding of diff output (#52994)
+
Version 5.18 - 1 October 2009, Thierry Vignaud
- edit-urpm-sources:
diff --git a/Rpmdrake/rpmnew.pm b/Rpmdrake/rpmnew.pm
index 325882be..6980b567 100644
--- a/Rpmdrake/rpmnew.pm
+++ b/Rpmdrake/rpmnew.pm
@@ -73,7 +73,11 @@ sub inspect {
-r $rpmnew or $rpmfile = 'rpmsave';
-r $rpmnew && -r $rpmsave && (stat $rpmsave)[9] > (stat $rpmnew)[9] and $rpmfile = 'rpmsave';
$rpmfile eq 'rpmsave' and $rpmnew = $rpmsave;
- my @diff = `/usr/bin/diff -u '$file' '$rpmnew'`;
+
+ 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 @diff = map { ensure_utf8($_) } `/usr/bin/diff -u '$file' '$rpmnew'`;
@diff = N("(none)") if !@diff;
my $d = ugtk2->new(N("Inspecting %s", $file), grab => 1, transient => $::main_window);
my $save_wsize = sub { @inspect_wsize = $d->{rwindow}->get_size };