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

[SCM] Debian package checker branch, master, updated. 2.1.3-49-g4e913bc



The following commit has been merged in the master branch:
commit 3c53e5d05853a339d2341e12d1b0deccbcbb8380
Author: Russ Allbery <rra@debian.org>
Date:   Tue Dec 30 22:19:01 2008 -0800

    Warn of binary control stanzas duplicating source settings
    
    * checks/control-file{,.desc}:
      + [RA] Warn (severity: wishlist) of binary control stanzas duplicating
        fields of the source control stanza.  (Closes: #497348)

diff --git a/checks/control-file b/checks/control-file
index d778696..7db82f7 100644
--- a/checks/control-file
+++ b/checks/control-file
@@ -75,6 +75,10 @@ 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"});
+	for my $field (keys %$binary_control) {
+		tag 'binary-control-field-duplicates-source', $field, "in package ".$binary_control->{'package'},
+		    if ($header->{$field} && $binary_control->{$field} eq $header->{$field});
+	}
 }
 
 # Make sure that a stronger dependency field doesn't imply any of the elements
diff --git a/checks/control-file.desc b/checks/control-file.desc
index 8dde6d8..c2011be 100644
--- a/checks/control-file.desc
+++ b/checks/control-file.desc
@@ -34,6 +34,15 @@ 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.
 
+Tag: binary-control-field-duplicates-source
+Severity: wishlist
+Certainty: certain
+Info: In <tt>debian/control</tt>, this field for a binary package
+ duplicates the value inherited from the source package paragraph.  This
+ doesn't hurt anything, but you may want to take advantage of the
+ inheritance and set the value in only one place.  It prevents missing
+ duplicate places that need to be fixed if the value ever changes.
+
 Tag: debian-control-file-is-a-symlink
 Severity: normal
 Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index c7cfd67..674aebe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ lintian (2.1.4) UNRELEASED; urgency=low
 
   * Summary of tag changes:
     + Added
+      - binary-control-field-duplicates-source
       - brace-expansion-in-debhelper-config-file
       - control-interpreter-in-usr-local (split from
          interpreter-in-usr-local)
@@ -24,6 +25,9 @@ lintian (2.1.4) UNRELEASED; urgency=low
       or "unstable", or with release code names for uploads not targeted
       at that release, except in NMUs.  Based on a patch by Raphael
       Geissert.  (Closes: #498876)
+  * checks/control-file{,.desc}:
+    + [RA] Warn (severity: wishlist) of binary control stanzas duplicating
+      fields of the source control stanza.  (Closes: #497348)
   * checks/copyright-file{,.desc}:
     + [RA] Warn (severity: wishlist) about the old dh_make packaging
       copyright, which used (C) without the word or symbol.  Based on a
diff --git a/t/tests/6000_control-file-general.desc b/t/tests/6000_control-file-general.desc
new file mode 100644
index 0000000..520c2d4
--- /dev/null
+++ b/t/tests/6000_control-file-general.desc
@@ -0,0 +1,9 @@
+Testname: control-file-general
+Version: 1.0
+Description: Various problems with debian/control
+Test-For:
+ binary-control-field-duplicates-source
+ build-info-in-binary-control-file-section
+ no-section-field-for-source
+ package-depends-on-itself
+ stronger-dependency-implies-weaker
diff --git a/t/templates/skel/debian/control.in b/t/tests/control-file-general/debian/debian/control.in
similarity index 66%
copy from t/templates/skel/debian/control.in
copy to t/tests/control-file-general/debian/debian/control.in
index f8f5c04..567bd11 100644
--- a/t/templates/skel/debian/control.in
+++ b/t/tests/control-file-general/debian/debian/control.in
@@ -1,13 +1,18 @@
 Source: {$srcpkg}
 Priority: extra
-Section: {$section}
 Maintainer: {$author}
 Standards-Version: 3.8.0
 Build-Depends: debhelper (>= 7)
+X-VCS-Svn: svn://svn.example.com/{$srcpkg}/trunk
 
 Package: {$srcpkg}
+Section: {$section}
+Maintainer: {$author}
+Build-Conflicts: foo
 Architecture: {$architecture}
-Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Depends: {$srcpkg}, foo, baz, $\{shlibs:Depends\}, $\{misc:Depends\}
+Recommends: foo, bar
+Suggests: bar | baz
 Description: {$description}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
diff --git a/t/tests/control-file-general/tags b/t/tests/control-file-general/tags
new file mode 100644
index 0000000..f9d5db2
--- /dev/null
+++ b/t/tests/control-file-general/tags
@@ -0,0 +1,7 @@
+E: control-file-general source: build-info-in-binary-control-file-section Package control-file-general
+I: control-file-general source: binary-control-field-duplicates-source maintainer in package control-file-general
+W: control-file-general source: no-section-field-for-source
+W: control-file-general source: package-depends-on-itself control-file-general depends
+W: control-file-general source: stronger-dependency-implies-weaker control-file-general depends -> recommends foo
+W: control-file-general source: stronger-dependency-implies-weaker control-file-general depends -> suggests bar | baz
+W: control-file-general source: stronger-dependency-implies-weaker control-file-general recommends -> suggests bar | baz
diff --git a/testset/tags.binary b/testset/tags.binary
index b525026..83d7a58 100644
--- a/testset/tags.binary
+++ b/testset/tags.binary
@@ -50,6 +50,7 @@ E: binary: su-wrapper-without--c /usr/share/menu/binary:3 sux
 E: binary: suidregister-used-in-maintainer-script postinst
 E: binary: symlink-contains-spurious-segments usr/share/doc/binary/html/ch2.html ../html/./ch1.html
 E: binary: unstripped-binary-or-object ./usr/bin/hello
+I: binary source: binary-control-field-duplicates-source vcs-svn in package binary
 I: binary source: xs-vcs-header-in-debian-control xs-vcs-browser
 I: binary: arch-dep-package-has-big-usr-share
 I: binary: binary-has-unneeded-section ./usr/bin/hello-static .comment

-- 
Debian package checker


Reply to: