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

Bug#174982: lintian patch



Well, I whipped up a quick lintian patch to check for this, which I will
submit against lintian once this proposal gathers the necessary
seconds.  I've attached it for now in case anyone else wants to see how
many packages are broken on their machine.

Here are some statistics that may be of interest, taken from my apt
cache, since I last ran apt-get clean on my laptop.

walters@space-ghost> ls *.deb | wc -l
     86
walters@space-ghost> lintian *.deb | grep 'uses-obsolete-national-charset'
E: pan: debian-changelog-file-uses-obsolete-national-charset
E: mkisofs: debian-changelog-file-uses-obsolete-national-charset
E: libtool-doc: debian-changelog-file-uses-obsolete-national-charset
E: debconf-utils: debian-changelog-file-uses-obsolete-national-charset
E: debconf-doc: debian-changelog-file-uses-obsolete-national-charset
E: debconf: debian-changelog-file-uses-obsolete-national-charset
E: cdrecord: debian-changelog-file-uses-obsolete-national-charset
walters@space-ghost>

diff -ru lintian-1.22.4/checks/changelog-file lintian-1.22.4.hacked/checks/changelog-file
--- lintian-1.22.4/checks/changelog-file	2002-11-23 20:08:00.000000000 -0500
+++ lintian-1.22.4.hacked/checks/changelog-file	2003-01-02 03:32:42.000000000 -0500
@@ -20,6 +20,7 @@
 # MA 02111-1307, USA.
 
 use strict;
+use utf8;
 
 ($#ARGV == 1) or fail("syntax: changelog-file <pkg> <type>");
 my $pkg = shift;
@@ -190,6 +191,15 @@
     }
 }
 
+open (IN, "<:utf8", "changelog") or fail("cannot find changelog for $type package $pkg");
+while (<IN>) {
+  unless (utf8::valid($_)) {
+    print "E: $pkg $type: debian-changelog-file-uses-obsolete-national-charset\n";
+    last;
+  }
+}
+close IN;
+
 # read the changelog itself
 #
 # emacs only looks at the last "local variables:" in a file, and only at
diff -ru lintian-1.22.4/checks/changelog-file.desc lintian-1.22.4.hacked/checks/changelog-file.desc
--- lintian-1.22.4/checks/changelog-file.desc	2002-11-23 20:09:54.000000000 -0500
+++ lintian-1.22.4.hacked/checks/changelog-file.desc	2003-01-02 03:34:54.000000000 -0500
@@ -89,3 +89,16 @@
  files.  Instead, put something like this in your ~/.emacs:
  .
  (setq debian-changelog-mailing-address "userid@debian.org")
+
+Tag: debian-changelog-file-uses-obsolete-national-charset
+Type: error
+Info: The Debian changelog file must be valid UTF-8, an encoding of
+ the Unicode character set. 
+ .
+ There are many ways to convert a changelog from an obsoleted charset
+ like ISO-8859-1; you may for example use "iconv" like:
+ .
+ $ iconv --from-code=ISO-8859-1 --to-code=UTF-8 changelog > changelog.new
+ .
+ $ mv changelog.new changelog
+Ref: policy 5.3

Reply to: