[lintian] 01/01: Add a pedantic warning for upstream tarballs that contain empty directories as these can cause problems with git-buildpackage. (Closes: #894368)
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository lintian.
commit c1f3de8031d3e1bea0e6b2d74614eccd0f20ca92
Author: Chris Lamb <lamby@debian.org>
Date: Thu Mar 29 20:34:01 2018 +0100
Add a pedantic warning for upstream tarballs that contain empty directories as these can cause problems with git-buildpackage. (Closes: #894368)
---
checks/cruft.desc | 18 ++++++++++++++++++
checks/cruft.pm | 6 ++++++
debian/changelog | 4 ++++
t/tests/cruft-source-contains-empty-directory/desc | 8 ++++++++
.../cruft-source-contains-empty-directory/pre_upstream | 5 +++++
t/tests/cruft-source-contains-empty-directory/tags | 2 ++
6 files changed, 43 insertions(+)
diff --git a/checks/cruft.desc b/checks/cruft.desc
index c469fdd..8f05b3d 100644
--- a/checks/cruft.desc
+++ b/checks/cruft.desc
@@ -953,3 +953,21 @@ Info: This Debian package ships Lintian source-level overrides in the
<tt>debian/source</tt> directory is preferred to hold "source"-specific
files.
Ref: lintian 2.4
+
+Tag: source-contains-empty-directory
+Severity: pedantic
+Certainty: certain
+Info: The upstream source tree of this package contains an empty
+ directory.
+ .
+ Having an empty directory in itself does not cause problems but empty
+ directories cannot be stored in Git.
+ .
+ Keeping the empty directory in the source package can prevent others
+ from contributing to the package when using tools like
+ <tt>git-buildpackage(1)</tt>. In this workflow the empty directory
+ would be lost potentially causing errors if the installed binary
+ package or its tests subsequently rely upon them.
+ .
+ Please ask upstream to remove these directories prior to release or to
+ include an empty <tt>.gitignore</tt> file where necessary.
diff --git a/checks/cruft.pm b/checks/cruft.pm
index 9bdb20d..b59f90c 100644
--- a/checks/cruft.pm
+++ b/checks/cruft.pm
@@ -439,6 +439,12 @@ sub run {
}
}
+ foreach my $file ($info->sorted_orig_index) {
+ tag 'source-contains-empty-directory', $file
+ if $file->is_dir
+ and scalar($file->children) == 0;
+ }
+
return;
} # </run>
diff --git a/debian/changelog b/debian/changelog
index 3823451..6bf47ac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,10 @@ lintian (2.5.81) UNRELEASED; urgency=medium
+ [CL] Correct location of "AutomaticDebugPackages" wiki page in the
description of the debian-control-has-obsolete-dbg-package tag.
Thanks to Antonio Ospite for the report. (Closes: #893480)
+ * checks/cruft.{desc,pm}:
+ + [CL] Add a pedantic warning for upstream tarballs that contain empty
+ directories as these can cause problems with git-buildpackage.
+ Thanks to Balint Reczey for the idea! (Closes: #894368)
* checks/files.pm:
+ [CL] Add .ogg files to the list of non-license file extensions to
avoid a false-positive in extra-license-file. Thanks to Innocent De
diff --git a/t/tests/cruft-source-contains-empty-directory/desc b/t/tests/cruft-source-contains-empty-directory/desc
new file mode 100644
index 0000000..2b75f5d
--- /dev/null
+++ b/t/tests/cruft-source-contains-empty-directory/desc
@@ -0,0 +1,8 @@
+Testname: cruft-source-contains-empty-directory
+Version: 1.0-1
+Description: Check for empty directories in source package
+Skeleton: pedantic
+Options: --pedantic -I -E
+Type: non-native
+Test-For:
+ source-contains-empty-directory
diff --git a/t/tests/cruft-source-contains-empty-directory/pre_upstream b/t/tests/cruft-source-contains-empty-directory/pre_upstream
new file mode 100755
index 0000000..50fa993
--- /dev/null
+++ b/t/tests/cruft-source-contains-empty-directory/pre_upstream
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+mkdir "$1/empty"
diff --git a/t/tests/cruft-source-contains-empty-directory/tags b/t/tests/cruft-source-contains-empty-directory/tags
new file mode 100644
index 0000000..956ef95
--- /dev/null
+++ b/t/tests/cruft-source-contains-empty-directory/tags
@@ -0,0 +1,2 @@
+P: cruft-source-contains-empty-directory source: debian-watch-does-not-check-gpg-signature
+P: cruft-source-contains-empty-directory source: source-contains-empty-directory empty/
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: