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

rouca pushed a commit to branch utf8fix
in repository lintian.

commit 7c1c0565ab32869788107efb359078ca90c1fb6b
Author: Bastien ROUCARIÈS <roucaries.bastien+deb...@gmail.com>
Date:   Tue Jul 21 23:31:42 2015 +0200

    Read file as a whole for utf8 testing
    
    Avoid a test failure latter
---
 lib/Test/Lintian.pm | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/lib/Test/Lintian.pm b/lib/Test/Lintian.pm
index 68cbb6e..4566152 100644
--- a/lib/Test/Lintian.pm
+++ b/lib/Test/Lintian.pm
@@ -77,7 +77,7 @@ use Lintian::Profile;
 use Lintian::Tag::Info;
 use Lintian::Tags;
 use Lintian::Util
-  qw(read_dpkg_control slurp_entire_file is_string_utf8_encoded);
+  qw(read_dpkg_control slurp_entire_file file_is_encoded_in_non_utf8);
 
 # We want data files loaded early to avoid problems with missing data
 # files ending up in releases (like in 2.5.17 and 2.5.18).
@@ -174,6 +174,14 @@ sub test_check_desc {
 
     foreach my $desc_file (map { _find_check($find_opt, $_) } @descs) {
         my ($header, @tagpara);
+        # check utf-8
+        my $not_utf8_line = file_is_encoded_in_non_utf8($path);
+        if ($not_utf8_line) {
+            $builder->ok(0, "$desc_file is not utf-8");
+            $builder->diag("Error: line $not_utf8_line");
+            next;
+        }
+
         eval {($header, @tagpara) = read_dpkg_control($desc_file);};
         if (my $err = $@) {
             $err =~ s/ at .*? line \d+\s*\n//;
@@ -339,11 +347,6 @@ sub test_check_desc {
                   or $builder->diag("$content_type $cname: $tag ($1)\n");
             }
 
-            $builder->ok(
-                is_string_utf8_encoded($info),
-                'Tag info must be written in UTF-8'
-            ) or $builder->diag("$content_type $cname: $tag\n");
-
             # Check the tag info for unescaped <> or for unknown tags (which
             # probably indicate the same thing).
             while ($info =~ s,<([^\s>]+)(?:\s+href=\"[^\"]+\")?>.*?</\1>,,s) {

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

Reply via email to