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

lintian: r269 - in trunk: checks debian testset testset/foo++/debian



Author: he
Date: 2004-05-13 16:01:31 +0200 (Thu, 13 May 2004)
New Revision: 269

Added:
   trunk/checks/control-file
   trunk/checks/control-file.desc
Modified:
   trunk/debian/changelog
   trunk/testset/foo++/debian/control
   trunk/testset/tags.foo++
Log:
* checks/control-file{,.desc}:
  + [HE] Introduced new check script. New checks:
    - build-info-in-binary-control-file-section, triggered
      by a Build-* field in a binary section (Closes: #94928)
    - debian-control-file-uses-obsolete-national-encoding, stolen from
      changelog-file (Closes: #247197)



Added: trunk/checks/control-file
===================================================================
--- trunk/checks/control-file	2004-05-11 23:36:49 UTC (rev 268)
+++ trunk/checks/control-file	2004-05-13 14:01:31 UTC (rev 269)
@@ -0,0 +1,56 @@
+# control-file -- lintian check script
+#
+# Copyright (C) 2004 Marc Brockschmidt
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA.
+
+package Lintian::control_file;
+use strict;
+use Util;
+use Tags;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+# check that control is UTF-8 encoded
+open ICONV, "env LANG=C iconv -f utf8 -t utf8 debfiles/control 2>&1 |"
+	or fail("failure while checking encoding of control for $type package $pkg");
+my $line = 1;
+while (<ICONV>) {
+	if (m/iconv: illegal input sequence at position \d+$/) {
+		tag "debian-control-file-uses-obsolete-national-encoding", "at line $line";
+		last;
+    }
+    $line++;
+}
+close ICONV;
+
+my ($header, @binary_controls) = read_dpkg_control("debfiles/control");
+
+for my $binary_control (@binary_controls) {
+	tag "build-info-in-binary-control-file-section", "Package ".$binary_control->{"package"}
+	    if ($binary_control->{"build-depends"} || $binary_control->{"build-depends-indep"} ||
+	        $binary_control->{"build-conflicts"} || $binary_control->{"build-conflicts-indep"});
+}
+
+}
+
+1;
+
+# vim: syntax=perl sw=4 ts=4 noet shiftround

Added: trunk/checks/control-file.desc
===================================================================
--- trunk/checks/control-file.desc	2004-05-11 23:36:49 UTC (rev 268)
+++ trunk/checks/control-file.desc	2004-05-13 14:01:31 UTC (rev 269)
@@ -0,0 +1,27 @@
+Check-Script: control-file
+Author: Marc 'HE' Brockschmidt <marc@marcbrockschmidt.de>
+Abbrev: dctl
+Standards-Version: 3.6.1
+Type: source
+Unpack-Level: 1
+Needs-Info: debfiles
+Info: This script checks debian/control files
+
+Tag: debian-control-file-uses-obsolete-national-encoding
+Type: error
+Info: The Debian changelog file should be valid UTF-8, an encoding of
+ the Unicode character set.
+ .
+ There are many ways to convert a control from an obsoleted encoding
+ like ISO-8859-1; you may for example use "iconv" like:
+ .
+  $ iconv -f ISO-8859-1 -t UTF-8 control > control.new
+  $ mv control.new control
+
+Tag: build-info-in-binary-control-file-section
+Type: error
+Ref: policy 5.2
+Info: The control file has a `Build-Depends', `Build-Depends-Indep',
+ `Build-Conflicts' or `Build-Conflicts-Indep' field in a binary
+ section.  These specify source package relationships, and should be in
+ the source section of the control file.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2004-05-11 23:36:49 UTC (rev 268)
+++ trunk/debian/changelog	2004-05-13 14:01:31 UTC (rev 269)
@@ -10,6 +10,12 @@
        debian-changelog-file-uses-obsolete-national-charset ->
          debian-changelog-file-uses-obsolete-national-encoding
       (Closes: #248194)
+  * checks/control-file{,.desc}:
+    + [HE] Introduced new check script. New checks:
+      - build-info-in-binary-control-file-section, triggered
+        by a Build-* field in a binary section (Closes: #94928)
+      - debian-control-file-uses-obsolete-national-encoding, stolen from
+        changelog-file (Closes: #247197)
   * checks/cruft{,.desc}:
     + [JvW] cvsignore-file-in-source is now info, because it happens so often
       by upstream, and is only very minor in size

Modified: trunk/testset/foo++/debian/control
===================================================================
--- trunk/testset/foo++/debian/control	2004-05-11 23:36:49 UTC (rev 268)
+++ trunk/testset/foo++/debian/control	2004-05-13 14:01:31 UTC (rev 269)
@@ -9,10 +9,13 @@
 
 Package: foo++
 Architecture: all
+Build-Depends: test
 Depends: test
 Description: see how lintian reacts to plus signs in the package name
  Regression test to see if lintian tests work on a package with plus signs in
  its name.
+ .
+ This description also uses non-UTF8 high bytes chars: ��
 
 Package: foo++-helper
 Architecture: all

Modified: trunk/testset/tags.foo++
===================================================================
--- trunk/testset/tags.foo++	2004-05-11 23:36:49 UTC (rev 268)
+++ trunk/testset/tags.foo++	2004-05-13 14:01:31 UTC (rev 269)
@@ -17,3 +17,5 @@
 W: foo++ source: uploader-not-full-name Frank
 W: foo++ source: uploader-not-full-name Josip
 W: foo++: readme-debian-contains-debmake-default-email-address
+E: foo++ source: build-info-in-binary-control-file-section Package foo++
+E: foo++ source: debian-control-file-uses-obsolete-national-encoding at line 18



Reply to: