The following commit has been merged in the master branch: commit dbb0a6ce96f32b0479aed588ff9fb2fec502ece0 Author: Russ Allbery <r...@debian.org> Date: Sun Jan 11 21:22:02 2009 -0800
Warn if the Debian diff is entirely empty * checks/cruft{,.desc}: + [RA] Warn if the Debian diff or a non-native package is entirely empty. (Closes: #498668) diff --git a/checks/cruft b/checks/cruft index 6710b28..f8c4e70 100644 --- a/checks/cruft +++ b/checks/cruft @@ -132,11 +132,13 @@ find($wanted, 'unpacked'); # name of a file containing diffstat output. sub check_diffstat { my ($diffstat, $warned) = @_; + my $saw_file; open(STAT, '<', $diffstat) or fail("cannot open $diffstat: $!"); local $_; while (<STAT>) { my ($file) = (m,^\s+(.*?)\s+\|,) or fail("syntax error in diffstat file: $_"); + $saw_file = 1; # Check for CMake cache files. These embed the source path and hence # will cause FTBFS on buildds, so they should never be touched in the @@ -178,6 +180,10 @@ sub check_diffstat { } } close(STAT) or fail("error reading diffstat file: $!"); + + # If there was nothing in the diffstat output, there was nothing in the + # diff, which is probably a mistake. + tag 'empty-debian-diff' unless $saw_file; } # Check each file in the source package for problems. By the time we get to diff --git a/checks/cruft.desc b/checks/cruft.desc index 1dfff4d..d434148 100644 --- a/checks/cruft.desc +++ b/checks/cruft.desc @@ -296,6 +296,22 @@ Info: Lintian found a substvars file in the Debian diff for this source the clean target. Ref: policy 4.9 +Tag: empty-debian-diff +Severity: normal +Certainty: possible +Info: The Debian diff of this non-native package appears to be completely + empty. This usually indicates a mistake when generating the upstream + tarball, or it may mean that this was intended to be a native package and + was built non-native by mistake. + . + If the Debian packaging is maintained in conjunction with upstream, this + may be intentional, but it's not recommended best practice. If the + software is only for Debian, it should be a native package; otherwise, + it's better to omit the <tt>debian</tt> directory from upstream releases + and add it in the Debian diff. Otherwise, it can cause problems for some + package updates in Debian (files can't be removed from the + <tt>debian</tt> directory via the diff, for example). + Tag: configure-generated-file-in-source Severity: normal Certainty: certain diff --git a/debian/changelog b/debian/changelog index a1b38d9..ddccf05 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ lintian (2.1.6) UNRELEASED; urgency=low Thanks, Joerg Jaspert. (Closes: #510957) + [RA] Warn about .hgtags files in the diff and source. Thanks, Holger Levsen and Chris Lamb. (Closes: #464837) + + [RA] Warn if the Debian diff or a non-native package is entirely + empty. (Closes: #498668) * checks/fields{,.desc}: + [ADB] Warn about an individual uploader appearing multiple times in Uploaders. Thanks, Joerg Jaspert. (Closes: #511536) diff --git a/t/tests/6000_cruft-empty-diff.desc b/t/tests/6000_cruft-empty-diff.desc new file mode 100644 index 0000000..75c4739 --- /dev/null +++ b/t/tests/6000_cruft-empty-diff.desc @@ -0,0 +1,5 @@ +Testname: cruft-empty-diff +Version: 1.0 +Description: Test an empty Debian diff +Test-For: empty-debian-diff +References: Debian Bug#498668 diff --git a/t/tests/cruft-empty-diff/debian/debian/changelog b/t/tests/cruft-empty-diff/debian/debian/changelog new file mode 100644 index 0000000..edd3294 --- /dev/null +++ b/t/tests/cruft-empty-diff/debian/debian/changelog @@ -0,0 +1,8 @@ +cruft-empty-diff (1.0) unstable; urgency=low + + * Lintian Test Suite. + * Test: basic + + * Suppress "should close ITP bug" messages. (Closes: #123456) + + -- Debian Lintian Maintainers <lintian-ma...@debian.org> Sun, 11 Jan 2009 21:03:14 -0800 diff --git a/t/templates/skel/debian/compat b/t/tests/cruft-empty-diff/debian/debian/compat similarity index 100% copy from t/templates/skel/debian/compat copy to t/tests/cruft-empty-diff/debian/debian/compat diff --git a/t/debs/deb-format-extra-member/control b/t/tests/cruft-empty-diff/debian/debian/control similarity index 61% copy from t/debs/deb-format-extra-member/control copy to t/tests/cruft-empty-diff/debian/debian/control index 23e33a5..b7becb7 100644 --- a/t/debs/deb-format-extra-member/control +++ b/t/tests/cruft-empty-diff/debian/debian/control @@ -1,10 +1,14 @@ -Package: deb-format-extra-member -Version: 1.0 -Architecture: all -Maintainer: Debian Lintian Maintainers <lintian-ma...@debian.org> -Section: devel +Source: cruft-empty-diff Priority: extra -Description: Test package for an ar archive in the wrong order +Section: devel +Maintainer: Debian Lintian Maintainers <lintian-ma...@debian.org> +Standards-Version: 3.8.0 +Build-Depends: debhelper (>= 7) + +Package: cruft-empty-diff +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Test an empty Debian diff 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 things. It should not be installed like a regular package. diff --git a/t/templates/skel/debian/copyright b/t/tests/cruft-empty-diff/debian/debian/copyright similarity index 100% copy from t/templates/skel/debian/copyright copy to t/tests/cruft-empty-diff/debian/debian/copyright diff --git a/t/templates/skel/debian/rules b/t/tests/cruft-empty-diff/debian/debian/rules similarity index 100% copy from t/templates/skel/debian/rules copy to t/tests/cruft-empty-diff/debian/debian/rules diff --git a/t/tests/cruft-empty-diff/pre_build b/t/tests/cruft-empty-diff/pre_build new file mode 100755 index 0000000..1d4817f --- /dev/null +++ b/t/tests/cruft-empty-diff/pre_build @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Remove files copied over from the skeleton but which aren't in the +# upstream tarball so that we exactly match. + +set -e +dir="$1" + +rm "${dir}"/debian/*.in diff --git a/t/tests/cruft-empty-diff/tags b/t/tests/cruft-empty-diff/tags new file mode 100644 index 0000000..290841b --- /dev/null +++ b/t/tests/cruft-empty-diff/tags @@ -0,0 +1 @@ +W: cruft-empty-diff source: empty-debian-diff diff --git a/t/tests/cruft-empty-diff/upstream/debian/changelog b/t/tests/cruft-empty-diff/upstream/debian/changelog new file mode 100644 index 0000000..edd3294 --- /dev/null +++ b/t/tests/cruft-empty-diff/upstream/debian/changelog @@ -0,0 +1,8 @@ +cruft-empty-diff (1.0) unstable; urgency=low + + * Lintian Test Suite. + * Test: basic + + * Suppress "should close ITP bug" messages. (Closes: #123456) + + -- Debian Lintian Maintainers <lintian-ma...@debian.org> Sun, 11 Jan 2009 21:03:14 -0800 diff --git a/t/templates/skel/debian/compat b/t/tests/cruft-empty-diff/upstream/debian/compat similarity index 100% copy from t/templates/skel/debian/compat copy to t/tests/cruft-empty-diff/upstream/debian/compat diff --git a/t/debs/deb-format-extra-member/control b/t/tests/cruft-empty-diff/upstream/debian/control similarity index 61% copy from t/debs/deb-format-extra-member/control copy to t/tests/cruft-empty-diff/upstream/debian/control index 23e33a5..b7becb7 100644 --- a/t/debs/deb-format-extra-member/control +++ b/t/tests/cruft-empty-diff/upstream/debian/control @@ -1,10 +1,14 @@ -Package: deb-format-extra-member -Version: 1.0 -Architecture: all -Maintainer: Debian Lintian Maintainers <lintian-ma...@debian.org> -Section: devel +Source: cruft-empty-diff Priority: extra -Description: Test package for an ar archive in the wrong order +Section: devel +Maintainer: Debian Lintian Maintainers <lintian-ma...@debian.org> +Standards-Version: 3.8.0 +Build-Depends: debhelper (>= 7) + +Package: cruft-empty-diff +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Test an empty Debian diff 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 things. It should not be installed like a regular package. diff --git a/t/templates/skel/debian/copyright b/t/tests/cruft-empty-diff/upstream/debian/copyright similarity index 100% copy from t/templates/skel/debian/copyright copy to t/tests/cruft-empty-diff/upstream/debian/copyright diff --git a/t/templates/skel/debian/rules b/t/tests/cruft-empty-diff/upstream/debian/rules similarity index 100% copy from t/templates/skel/debian/rules copy to t/tests/cruft-empty-diff/upstream/debian/rules -- Debian package checker -- To UNSUBSCRIBE, email to debian-lint-maint-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org