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

lintian: r433 - in trunk: checks debian testset testset/relations/debian



Author: he
Date: 2005-07-09 19:23:27 +0200 (Sat, 09 Jul 2005)
New Revision: 433

Modified:
   trunk/checks/control-file
   trunk/checks/control-file.desc
   trunk/debian/changelog
   trunk/testset/relations/debian/control
   trunk/testset/tags.relations
Log:
checks/control-file
  + [HE] Check for duplicated fields. (Closes: #299792)


Modified: trunk/checks/control-file
===================================================================
--- trunk/checks/control-file	2005-07-09 07:45:38 UTC (rev 432)
+++ trunk/checks/control-file	2005-07-09 17:23:27 UTC (rev 433)
@@ -34,6 +34,24 @@
     tag "debian-control-file-uses-obsolete-national-encoding", "at line $line"
 }
 
+# Check that each field is only used once:
+my $seen_fields = {};
+open (CONTROL, "debfiles/control") or fail "Couldn't read debfiles/control: $!";
+while (<CONTROL>) {
+	#Reset seen_fields if we enter a new section:
+	$seen_fields = {} if /^$/;
+
+	#line with field:
+	if (/^(\S+):/) {
+		my $field = lc ($1);
+		if ($seen_fields->{$field}) {
+			tag "debian-control-with-duplicate-fields", "$field: $$seen_fields{$field}, $.";
+		}
+		$seen_fields->{$field} = $.; 
+	}
+}
+close CONTROL;
+
 my ($header, @binary_controls) = read_dpkg_control("debfiles/control");
 
 for my $binary_control (@binary_controls) {

Modified: trunk/checks/control-file.desc
===================================================================
--- trunk/checks/control-file.desc	2005-07-09 07:45:38 UTC (rev 432)
+++ trunk/checks/control-file.desc	2005-07-09 17:23:27 UTC (rev 433)
@@ -25,3 +25,9 @@
  `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.
+
+Tag: debian-control-with-duplicate-fields
+Type: error
+Info: One of the paragraphs of your debian/control contains the same
+ field more than once. This can lead to an unexpected behaviour of dpkg
+ and apt.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2005-07-09 07:45:38 UTC (rev 432)
+++ trunk/debian/changelog	2005-07-09 17:23:27 UTC (rev 433)
@@ -7,6 +7,9 @@
       version 3.6.2. As the changes between 3.6.{1,2} aren't stuff we
       (can) check, this is actually true! (Closes: #317049)
 
+  * checks/control-file
+    + [HE] Check for duplicated fields. (Closes: #299792)
+
   * checks/fields:
     + [HE] Change unknown-architecture a bit: We don't complain about
       "known" non-standard archs (like amd64, ppc64, *bsd-i386) and only

Modified: trunk/testset/relations/debian/control
===================================================================
--- trunk/testset/relations/debian/control	2005-07-09 07:45:38 UTC (rev 432)
+++ trunk/testset/relations/debian/control	2005-07-09 17:23:27 UTC (rev 433)
@@ -28,6 +28,7 @@
 Architecture: all
 Depends: libstdc++2.10, libstdc++2.10-glibc2.2, libstdc++3.0, tk8.2, tk8.3, tcl8.0, tcl8.2, tkx8.2, tkx8.3, tclx8.2, libpng2, libpng3
 Provides: awk
+Provides: awk
 Description: Duplicate library dependency relationships.
  Duplicate library dependency relationships. This tests the depending on
  different versions of the same library at the same time.

Modified: trunk/testset/tags.relations
===================================================================
--- trunk/testset/tags.relations	2005-07-09 07:45:38 UTC (rev 432)
+++ trunk/testset/tags.relations	2005-07-09 17:23:27 UTC (rev 433)
@@ -1,6 +1,7 @@
 E: relations source: bad-relation build-depends: foo (>> 2) bar baz bat
 E: relations source: build-depends-on-essential-package-without-using-version build-depends-indep: bash
 E: relations source: build-depends-on-essential-package-without-using-version build-depends: findutils
+E: relations source: debian-control-with-duplicate-fields provides: 30, 31
 E: relations source: depends-on-build-essential-package-without-using-version libc6-dev [build-depends: libc6-dev]
 E: relations source: depends-on-build-essential-package-without-using-version make [build-depends-indep: make]
 E: relations-multiple-libs: description-synopsis-is-duplicated



Reply to: