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

lintian: r1240 - in trunk: checks debian testset testset/binary/debian



Author: rra
Date: 2008-03-03 23:06:16 +0100 (Mon, 03 Mar 2008)
New Revision: 1240

Modified:
   trunk/checks/menus
   trunk/checks/menus.desc
   trunk/debian/changelog
   trunk/testset/binary/debian/doc-base
   trunk/testset/tags.binary
Log:
* checks/menus{,desc}:
  + [RA] Check that doc-base files are encoded in UTF-8.  Thanks, Robert
    Luberda.  (Closes: #468759)

Modified: trunk/checks/menus
===================================================================
--- trunk/checks/menus	2008-03-03 21:52:56 UTC (rev 1239)
+++ trunk/checks/menus	2008-03-03 22:06:16 UTC (rev 1240)
@@ -122,7 +122,6 @@
 	    if ($perm =~ m,x,o) {
 		tag "executable-in-usr-share-docbase", $file, sprintf("%04o",$operm);
 	    }
-
 	    $docbase_file = $file;
 	}
 	#menu-methods file?
@@ -180,7 +179,7 @@
     while (defined ($dbfile = readdir DOCBASEDIR)) {
 	# don't try to parse executables, plus we already warned about it
 	next if -x "doc-base/$dbfile";
-	check_doc_base_file($dbfile);
+	check_doc_base_file($dbfile, $pkg, $type);
     }
     closedir DOCBASEDIR;
 } else {
@@ -217,14 +216,19 @@
 # -----------------------------------
 
 sub check_doc_base_file {
-    my $dbfile = shift;
+    my ($dbfile, $pkg, $type) = @_;
 
+    my $line = file_is_encoded_in_non_utf8("doc-base/$dbfile", $type, $pkg);
+    if ($line) {
+	tag 'doc-base-file-uses-obsolete-national-encoding', "$dbfile:$line";
+    }
+
     open (IN, '<', "doc-base/$dbfile")
         or fail("cannot open doc-base file $dbfile for reading.");
 
     my (@files, $field, @vals);
     my $knownfields = \%known_docbase_main_fields;
-    my $line        = 0;  # global
+    $line           = 0;  # global
     my %sawfields   = (); # local for each section of control file
     my %sawformats  = (); # global for control file
 

Modified: trunk/checks/menus.desc
===================================================================
--- trunk/checks/menus.desc	2008-03-03 21:52:56 UTC (rev 1239)
+++ trunk/checks/menus.desc	2008-03-03 22:06:16 UTC (rev 1240)
@@ -288,3 +288,14 @@
  separator.  The section separator is an empty line and should not contain
  any whitespace.
 Ref: Debian doc-base Manual section 2.3.2
+
+Tag: doc-base-file-uses-obsolete-national-encoding
+Type: error
+Info: doc-base files must be valid UTF-8, an encoding of the Unicode
+ character set.
+ .
+ There are many ways to convert a doc-base file from an obsolete encoding
+ like ISO-8859-1.  You may, for example, use "iconv" like:
+ .
+  $ iconv -f ISO-8859-1 -t UTF-8 doc-base &gt; doc-base.new
+  $ mv doc-base.new doc-base

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-03-03 21:52:56 UTC (rev 1239)
+++ trunk/debian/changelog	2008-03-03 22:06:16 UTC (rev 1240)
@@ -50,6 +50,9 @@
     + [RA] When the menu or desktop file invokes a quoted command via an
       su program, don't try to check whether the command is in the
       package.  Thanks, Paul Wise.  (Closes: #466665)
+  * checks/menus{,desc}:
+    + [RA] Check that doc-base files are encoded in UTF-8.  Thanks, Robert
+      Luberda.  (Closes: #468759)
   * check/patch-systems:
     + [HE] Warn if the .diff.gz contains changes while the package uses
       a patch system. (Closes: #452215)

Modified: trunk/testset/binary/debian/doc-base
===================================================================
--- trunk/testset/binary/debian/doc-base	2008-03-03 21:52:56 UTC (rev 1239)
+++ trunk/testset/binary/debian/doc-base	2008-03-03 22:06:16 UTC (rev 1240)
@@ -5,7 +5,7 @@
   files, including several things that aren't tested yet.  The third and
   fourth one has trailing whitespace.
   .
- This section has a speling error.
+ This section has a speling error and bad � character.
  .
  The above separator was fine.
 Section: Non/Existant

Modified: trunk/testset/tags.binary
===================================================================
--- trunk/testset/tags.binary	2008-03-03 21:52:56 UTC (rev 1239)
+++ trunk/testset/tags.binary	2008-03-03 22:06:16 UTC (rev 1240)
@@ -18,6 +18,7 @@
 E: binary: doc-base-file-references-missing-file binary:34 /usr/share/info/binary.info.gz
 E: binary: doc-base-file-unknown-field binary:12 unknown
 E: binary: doc-base-file-unknown-field binary:18 unknown
+E: binary: doc-base-file-uses-obsolete-national-encoding binary:8
 E: binary: doc-base-index-references-multiple-files binary:25
 E: binary: doc-base-invalid-document-field binary:1 binary!docs  
 E: binary: executable-desktop-file /usr/share/applications/goodbye.desktop 0755


Reply to: