[SCM] Debian package checker branch, master, updated. 2.1.5-3-g7510c0b
The following commit has been merged in the master branch:
commit 7510c0b19979364c4c42ecd073485bb61a04f573
Author: Russ Allbery <rra@debian.org>
Date: Sat Jan 10 23:49:32 2009 -0800
Error on CMakeCache.txt files added or modified in the diff
* checks/cruft{,.desc}:
+ [RA] Error on CMakeCache.txt files added or modified in the diff.
Thanks, Joerg Jaspert. (Closes: #510957)
diff --git a/checks/cruft b/checks/cruft
index 5b3c127..4fcaab0 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -137,11 +137,18 @@ sub check_diffstat {
my ($file) = (m,^\s+(.*?)\s+\|,)
or fail("syntax error in diffstat file: $_");
- # We only care about diffs that add files. If the file is being
- # modified, that's not a problem with the diff and we'll catch it
- # later when we check the source. This regex doesn't catch only file
- # adds, just any diff that doesn't remove lines from a file, but it's
- # a good guess.
+ # 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
+ # diff.
+ if ($file =~ m,(^|/)CMakeCache.txt\z,) {
+ tag 'diff-contains-cmake-cache-file', $file;
+ }
+
+ # For everything else, we only care about diffs that add files. If
+ # the file is being modified, that's not a problem with the diff and
+ # we'll catch it later when we check the source. This regex doesn't
+ # catch only file adds, just any diff that doesn't remove lines from a
+ # file, but it's a good guess.
next unless m,\|\s+\d+\s+\++$,;
# diffstat output contains only files, but we consider the directory
diff --git a/checks/cruft.desc b/checks/cruft.desc
index 2e4e609..d32076c 100644
--- a/checks/cruft.desc
+++ b/checks/cruft.desc
@@ -33,6 +33,17 @@ Info: Leaving <tt>debian/files</tt> causes problems for the autobuilders,
The clean rule for the package should remove this file.
Ref: policy 4.12
+Tag: diff-contains-cmake-cache-file
+Severity: serious
+Certainty: possible
+Info: The Debian diff contains a CMake cache file. These files embed the
+ full path of the source tree in which they're created and cause build
+ failures if they exist when the source is built under a different path,
+ so they will always cause errors on the buildds. The file was probably
+ accidentally included. If it is present in the upstream source, don't
+ modify it in the Debian diff; instead, delete it before the build in
+ <tt>debian/rules</tt>.
+
Tag: diff-contains-cvs-control-dir
Severity: normal
Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index c483947..9d444c2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+lintian (2.1.6) UNRELEASED; urgency=low
+
+ * Summary of tag changes:
+ + Added
+ - diff-contains-cmake-cache-file
+
+ * checks/cruft{,.desc}:
+ + [RA] Error on CMakeCache.txt files added or modified in the diff.
+ Thanks, Joerg Jaspert. (Closes: #510957)
+
+ -- Russ Allbery <rra@debian.org> Sat, 10 Jan 2009 23:47:46 -0800
+
lintian (2.1.5) unstable; urgency=low
* Summary of tag changes:
diff --git a/t/COVERAGE b/t/COVERAGE
index 959c955..ddc8313 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,4 +1,4 @@
-Last generated 2009-01-10
+Last generated 2009-01-11
The following tags are not tested by the test suite:
@@ -38,9 +38,6 @@ copyright-file spelling-error-in-copyright
copyright-file usr-share-doc-symlink-points-outside-of-usr-share-doc
copyright-file usr-share-doc-symlink-to-foreign-package
-cruft diff-contains-git-control-dir
-cruft diff-contains-hg-control-dir
-cruft diff-contains-patch-failure-file
cruft documentation-package-not-architecture-independent
cruft outdated-autotools-helper-file
cruft source-contains-arch-control-dir
@@ -321,19 +318,6 @@ copyright-file possible-gpl-code-linked-with-openssl
copyright-file usr-share-doc-symlink-without-dependency
cruft configure-generated-file-in-source
-cruft debian-files-list-in-source
-cruft diff-contains-arch-control-dir
-cruft diff-contains-arch-inventory-file
-cruft diff-contains-bts-control-dir
-cruft diff-contains-bzr-control-dir
-cruft diff-contains-cvs-conflict-copy
-cruft diff-contains-cvs-control-dir
-cruft diff-contains-editor-backup-file
-cruft diff-contains-substvars
-cruft diff-contains-svk-commit-file
-cruft diff-contains-svn-commit-file
-cruft diff-contains-svn-conflict-file
-cruft diff-contains-svn-control-dir
cruft native-package-with-dash-version
cruft source-contains-bts-control-dir
cruft source-contains-git-control-dir
diff --git a/t/tests/6000_cruft-general-diff.desc b/t/tests/6000_cruft-general-diff.desc
new file mode 100644
index 0000000..3208df6
--- /dev/null
+++ b/t/tests/6000_cruft-general-diff.desc
@@ -0,0 +1,22 @@
+Testname: cruft-general-diff
+Version: 1.0-1
+Type: non-native
+Description: Check for cruft added in the diff
+Test-For:
+ debian-files-list-in-source
+ diff-contains-arch-control-dir
+ diff-contains-arch-inventory-file
+ diff-contains-bts-control-dir
+ diff-contains-bzr-control-dir
+ diff-contains-cmake-cache-file
+ diff-contains-cvs-conflict-copy
+ diff-contains-cvs-control-dir
+ diff-contains-editor-backup-file
+ diff-contains-git-control-dir
+ diff-contains-hg-control-dir
+ diff-contains-patch-failure-file
+ diff-contains-substvars
+ diff-contains-svk-commit-file
+ diff-contains-svn-commit-file
+ diff-contains-svn-conflict-file
+ diff-contains-svn-control-dir
diff --git a/t/tests/basic-non-native/upstream/README b/t/tests/cruft-general-diff/debian/README
similarity index 100%
copy from t/tests/basic-non-native/upstream/README
copy to t/tests/cruft-general-diff/debian/README
diff --git a/t/tests/cruft-general-diff/debian/debian/files b/t/tests/cruft-general-diff/debian/debian/files
new file mode 100644
index 0000000..4c0ddb3
--- /dev/null
+++ b/t/tests/cruft-general-diff/debian/debian/files
@@ -0,0 +1 @@
+cruft-general-diff_1.0-1_all.deb devel extra
diff --git a/t/tests/cruft-general-diff/debian/debian/rules b/t/tests/cruft-general-diff/debian/debian/rules
new file mode 100755
index 0000000..d2231a2
--- /dev/null
+++ b/t/tests/cruft-general-diff/debian/debian/rules
@@ -0,0 +1,10 @@
+#!/usr/bin/make -f
+%:
+ dh $@
+
+build:
+ dh_prep -X~ -Xrej
+ dh build --remaining
+
+clean:
+ @echo 'Do nothing'
diff --git a/t/tests/cruft-general-diff/debian/debian/substvars b/t/tests/cruft-general-diff/debian/debian/substvars
new file mode 100644
index 0000000..abd3ebe
--- /dev/null
+++ b/t/tests/cruft-general-diff/debian/debian/substvars
@@ -0,0 +1 @@
+misc:Depends=
diff --git a/t/tests/cruft-general-diff/pre_build b/t/tests/cruft-general-diff/pre_build
new file mode 100755
index 0000000..6d34e47
--- /dev/null
+++ b/t/tests/cruft-general-diff/pre_build
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Create all the various junk that shouldn't exist in the diff so that we can
+# trigger all the tags.
+
+set -e
+dir="$1"
+
+mkdir "${dir}/CVS"
+echo 'diff-contains-cvs-control-dir' > "${dir}/CVS/Entries"
+mkdir "${dir}/.svn"
+echo 'diff-contains-svn-control-dir' > "${dir}/.svn/format"
+mkdir "${dir}/.bzr"
+echo 'diff-contains-bzr-control-dir' > "${dir}/.bzr/foo"
+mkdir "${dir}/{arch}"
+echo 'diff-contains-arch-control-dir' > "${dir}/{arch}/foo"
+mkdir "${dir}/.git"
+echo 'diff-contains-git-control-dir' > "${dir}/.git/foo"
+mkdir "${dir}/.hg"
+echo 'diff-contains-hg-control-dir' > "${dir}/.hg/foo"
+mkdir "${dir}/.be"
+echo 'diff-contains-bts-control-dir' > "${dir}/.be/foo"
+
+echo 'diff-contains-cmake-cache-file' > "${dir}/CMakeCache.txt"
+echo 'diff-contains-svn-commit-file' > "${dir}/svn-commit.tmp"
+echo 'diff-contains-svk-commit-file' > "${dir}/svk-commit444.tmp"
+echo 'diff-contains-arch-inventory-file' > "${dir}/.arch-inventory"
+echo 'diff-contains-cvs-conflict-copy' > "${dir}/.#foo.1.1"
+echo 'diff-contains-svn-conflict-file' > "${dir}/foo.r1352"
+echo 'diff-contains-patch-failure-file' > "${dir}/foo.rej"
+echo 'diff-contains-editor-backup-file' > "${dir}/foo~"
diff --git a/t/tests/cruft-general-diff/tags b/t/tests/cruft-general-diff/tags
new file mode 100644
index 0000000..66337aa
--- /dev/null
+++ b/t/tests/cruft-general-diff/tags
@@ -0,0 +1,17 @@
+E: cruft-general-diff source: debian-files-list-in-source
+E: cruft-general-diff source: diff-contains-cmake-cache-file CMakeCache.txt
+W: cruft-general-diff source: diff-contains-arch-control-dir {arch}
+W: cruft-general-diff source: diff-contains-arch-inventory-file .arch-inventory
+W: cruft-general-diff source: diff-contains-bts-control-dir .be
+W: cruft-general-diff source: diff-contains-bzr-control-dir .bzr
+W: cruft-general-diff source: diff-contains-cvs-conflict-copy .#foo.1.1
+W: cruft-general-diff source: diff-contains-cvs-control-dir CVS
+W: cruft-general-diff source: diff-contains-editor-backup-file foo~
+W: cruft-general-diff source: diff-contains-git-control-dir .git
+W: cruft-general-diff source: diff-contains-hg-control-dir .hg
+W: cruft-general-diff source: diff-contains-patch-failure-file foo.rej
+W: cruft-general-diff source: diff-contains-substvars debian/substvars
+W: cruft-general-diff source: diff-contains-svk-commit-file svk-commit444.tmp
+W: cruft-general-diff source: diff-contains-svn-commit-file svn-commit.tmp
+W: cruft-general-diff source: diff-contains-svn-conflict-file foo.r1352
+W: cruft-general-diff source: diff-contains-svn-control-dir .svn
diff --git a/t/tests/basic-non-native/upstream/README b/t/tests/cruft-general-diff/upstream/README
similarity index 100%
copy from t/tests/basic-non-native/upstream/README
copy to t/tests/cruft-general-diff/upstream/README
--
Debian package checker
Reply to: