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

[lintian] 01/01: L::Tags: Read lintian overrides files as UTF-8 encoded



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

nthykier pushed a commit to branch master
in repository lintian.

commit 9e0f2bd51f4fa5b1b584a26346c76169c9ac11a0
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Jul 31 12:01:09 2016 +0000

    L::Tags: Read lintian overrides files as UTF-8 encoded
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 debian/changelog                                                  | 3 +++
 lib/Lintian/Tags.pm                                               | 2 +-
 .../debian/debian/overrides-shown.lintian-overrides               | 1 +
 t/tests/overrides-shown/tags                                      | 8 ++++----
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 78b3fe0..724f81d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -66,6 +66,9 @@ lintian (2.5.46) UNRELEASED; urgency=medium
 
   * lib/Lintian/*.pm:
     + [JW] Fix typos.
+  * lib/Lintian/Tags.pm:
+    + [JW, NT] Fix mojibake in UTF-8 encoded comments for overrides.
+      (Closes: #833052)
 
   * man/lintian.pod.in:
     + [JW] Fix typo.
diff --git a/lib/Lintian/Tags.pm b/lib/Lintian/Tags.pm
index 1c4549b..9ca25c7 100644
--- a/lib/Lintian/Tags.pm
+++ b/lib/Lintian/Tags.pm
@@ -515,7 +515,7 @@ sub file_overrides {
     my $info = $self->{info}{$self->{current}};
     my $comments = [];
     my $last_over;
-    open(my $file, '<', $overrides);
+    open(my $file, '<:encoding(UTF-8)', $overrides);
     local $_;
   OVERRIDE:
     while (<$file>) {
diff --git a/t/tests/overrides-shown/debian/debian/overrides-shown.lintian-overrides b/t/tests/overrides-shown/debian/debian/overrides-shown.lintian-overrides
index 04ae11b..bda39f8 100644
--- a/t/tests/overrides-shown/debian/debian/overrides-shown.lintian-overrides
+++ b/t/tests/overrides-shown/debian/debian/overrides-shown.lintian-overrides
@@ -12,6 +12,7 @@ FSSTND-dir-in-manual-page usr/share/man/man1/foo.1.gz:4 /usr/dict/
 # These are wildcard overrides
 FSSTND-dir-in-manual-page usr/share/man/man1/foo.1.gz:2*
 FSSTND-dir-in-manual-page */foo.1.gz:5 /usr/doc/
+# Comments in UTF-8: ✓ (☃)
 FSSTND-dir-in-manual-page */foo.1.gz:3*
 
 # renamed tag
diff --git a/t/tests/overrides-shown/tags b/t/tests/overrides-shown/tags
index 7c7796e..0ebd291 100644
--- a/t/tests/overrides-shown/tags
+++ b/t/tests/overrides-shown/tags
@@ -1,4 +1,4 @@
-P: overrides-shown: renamed-tag package-install-apt-sources => package-installs-apt-sources at line 18
+P: overrides-shown: renamed-tag package-install-apt-sources => package-installs-apt-sources at line 19
 N: renamed tag
 O: overrides-shown: package-installs-apt-sources etc/apt/sources.list.d/
 N: renamed tag
@@ -18,11 +18,11 @@ N: These are wildcard overrides
 O: overrides-shown: FSSTND-dir-in-manual-page usr/share/man/man1/foo.1.gz:22 /var/catman/
 N: These are wildcard overrides
 O: overrides-shown: FSSTND-dir-in-manual-page usr/share/man/man1/foo.1.gz:23 /var/named/
-N: These are wildcard overrides
+N: Comments in UTF-8: ✓ (☃)
 O: overrides-shown: FSSTND-dir-in-manual-page usr/share/man/man1/foo.1.gz:30 /var/nis/
-N: These are wildcard overrides
+N: Comments in UTF-8: ✓ (☃)
 O: overrides-shown: FSSTND-dir-in-manual-page usr/share/man/man1/foo.1.gz:31 /var/preserve/
-N: These are wildcard overrides
+N: Comments in UTF-8: ✓ (☃)
 O: overrides-shown: FSSTND-dir-in-manual-page usr/share/man/man1/foo.1.gz:32 /usr/preserve/
 N: override without extra information
 O: overrides-shown: manpage-has-bad-whatis-entry usr/share/man/man1/foo.1.gz

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


Reply to: