[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/01: c/r-sync-state: Read mirror files as UTF-8 text



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit e907388e1932e8af0f15781e0064dbac321d141b
Author: Niels Thykier <niels@thykier.net>
Date:   Thu May 14 19:35:47 2015 +0200

    c/r-sync-state: Read mirror files as UTF-8 text
    
    We now read the state file correctly.  Unfortunately, we did not
    properly ensure that new data added to the file was correct because
    reporting-sync-state was reading mirror files without declaring the
    expected encoding.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 commands/reporting-sync-state.pm | 6 ++++--
 debian/changelog                 | 5 +++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/commands/reporting-sync-state.pm b/commands/reporting-sync-state.pm
index a650417..2fedcc8 100644
--- a/commands/reporting-sync-state.pm
+++ b/commands/reporting-sync-state.pm
@@ -434,11 +434,13 @@ sub prune_lintian_lab {
 sub _open_data_file {
     my ($file) = @_;
     if (-e $file) {
-        open(my $fd, '<', $file);
+        open(my $fd, '<:encoding(UTF-8)', $file);
         return $fd;
     }
     if (-e "${file}.gz") {
-        return open_gz("${file}.gz");
+        my $fd = open_gz("${file}.gz");
+        binmode($fd, 'encoding(UTF-8)');
+        return $fd;
     }
     die("Cannot find ${file}: file does not exist");
 }
diff --git a/debian/changelog b/debian/changelog
index 35e6200..793d252 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,11 @@ lintian (2.5.32) UNRELEASED; urgency=medium
     + [NT] Downgrade backports-changes-missing to a wishlist (I) tag.
       Thanks to Vincent Cheng for the report.  (Closes: #785084)
 
+  * commands/reporting-sync-state.pm:
+    + [NT] Read mirror files as UTF-8 files to avoid mojibake in
+      maintainer names.  Once again, thanks to Andreas Rönnquist
+      for the report.
+
   * debian/changelog:
     + [NT] Add missing list of new / removed tags to the
       entry for the previous release.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: