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

Bug#304866: Add warning for build-depends on lib<something not ending with -dev>



Attaching revised patch with testcases.


Regards,

-- 
Chris Lamb, UK                                       chris@chris-lamb.co.uk
                                                            GPG: 0x634F9A20
Index: checks/control-file.desc
===================================================================
--- checks/control-file.desc	(revision 1117)
+++ checks/control-file.desc	(working copy)
@@ -17,6 +17,11 @@
   $ iconv -f ISO-8859-1 -t UTF-8 control &gt; control.new
   $ mv control.new control
 
+Tag: build-depends-on-libfoo-not-libfoo-dev
+Type: warning
+Info: The package Build-Depends on a lib<something> package instead of
+ a lib<something>-dev package.
+
 Tag: build-info-in-binary-control-file-section
 Type: error
 Ref: policy 5.2
Index: checks/control-file
===================================================================
--- checks/control-file	(revision 1117)
+++ checks/control-file	(working copy)
@@ -71,6 +71,14 @@
 
 my ($header, @binary_controls) = read_dpkg_control("debfiles/control");
 
+if ($header->{'build-depends'}) {
+	for my $build_dep ( split /\s*,\s*/, $header->{'build-depends'}) {
+		$build_dep =~ s/\s*\(.*\)//;
+		tag("build-depends-on-libfoo-not-libfoo-dev", $build_dep)
+			if ($build_dep =~ m,^lib.+(?<!-dev)$,);
+	}
+}
+
 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"} ||
Index: testset/binary/debian/control
===================================================================
--- testset/binary/debian/control	(revision 1117)
+++ testset/binary/debian/control	(working copy)
@@ -3,6 +3,7 @@
 Priority: extra
 Maintainer: Lintian Maintainers <lintian-maint@debian.org>
 Uploaders: Co-maintainer one <one@debian.org>, Jeroen van Wolffelaar <jeroen@wolffelaar.nl>, Co-maintainer three <three@debian.org>
+Build-Depends: libc
 Standards-Version: 3.2.1
 Homepage: http://lintian.debian.org/
 Vcs-Svn: http://svn.wolffelaar.nl/lintian/trunk
Index: testset/tags.binary
===================================================================
--- testset/tags.binary	(revision 1117)
+++ testset/tags.binary	(working copy)
@@ -51,6 +51,7 @@
 I: binary: desktop-entry-contains-encoding-key /usr/share/applications/hello.desktop:13 Encoding
 I: binary: no-md5sums-control-file
 W: binary source: ancient-standards-version 3.2.1 (current is 3.7.3)
+W: binary source: build-depends-on-libfoo-not-libfoo-dev libc
 W: binary source: debian-rules-uses-pwd line 9
 W: binary source: maintainer-upload-has-incorrect-version-number 4-1.1
 W: binary source: native-package-with-dash-version

Attachment: signature.asc
Description: PGP signature


Reply to: