[SCM] Debian package checker branch, master, updated. 2.5.4-75-gc1ceb87
The following commit has been merged in the master branch:
commit 1fcc5492cbd0408cdc09cdce60472813827c5543
Author: Gergely Nagy <algernon@balabit.hu>
Date: Fri Dec 23 14:32:42 2011 +0100
checks/debhelper: Check dh-exec-install usage.
The dh-exec-install constructs are only allowed in .install files,
throw an error if they're found elsewhere.
Modifications to original patch:
- Use "$base" to determine if we are checking an ".install" file.
- Added new tag to "Test-For" in the test.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/checks/debhelper b/checks/debhelper
index 08ad875..071a99f 100644
--- a/checks/debhelper
+++ b/checks/debhelper
@@ -355,7 +355,7 @@ foreach my $file (sort readdir(DEBIAN)) {
# script.
if ( $cmd =~ /dh-exec/) {
$needdhexecbuilddepends = 1;
- _check_dh_exec ($cmd, "debian/$file", "$droot/$file");
+ _check_dh_exec ($cmd, $base, "debian/$file", "$droot/$file");
}
next;
}
@@ -495,7 +495,7 @@ sub _tag_if_executable {
# Perform various checks on a dh-exec file.
sub _check_dh_exec {
- my ($cmd, $pkgpath, $fspath) = @_;
+ my ($cmd, $base, $pkgpath, $fspath) = @_;
# Only /usr/bin/dh-exec is allowed, even if
# /usr/lib/dh-exec/dh-exec-subst works too.
@@ -516,6 +516,9 @@ sub _check_dh_exec {
tag 'dh-exec-script-without-dh-exec-features', $pkgpath;
}
+ if ( $dhe_install && $base ne 'install') {
+ tag 'dh-exec-install-not-allowed-here', $pkgpath;
+ }
}
# Return the command after the #! in the file (if any).
diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index 68e873b..12f6fed 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -350,3 +350,12 @@ Info: The package uses dh-exec in at least one of its files, but does
.
If the features provided by dh-exec is not needed, please remove the
executable bit, and the dh-exec usage.
+
+Tag: dh-exec-install-not-allowed-here
+Severity: important
+Certainty: possible
+Info: The package uses a dh-exec-install contruct in a non-.install
+ file.
+ .
+ The dh-exec-install constructs are only allowed in dh_install's
+ .install files, and nowhere else.
diff --git a/t/tests/debhelper-dh-exec/debian/debian/install b/t/tests/debhelper-dh-exec/debian/debian/install
new file mode 100755
index 0000000..bc147d0
--- /dev/null
+++ b/t/tests/debhelper-dh-exec/debian/debian/install
@@ -0,0 +1,2 @@
+#! /usr/bin/dh-exec
+usr/lib
diff --git a/t/tests/debhelper-dh-exec/debian/debian/manpages b/t/tests/debhelper-dh-exec/debian/debian/manpages
index 110b931..6c42b21 100755
--- a/t/tests/debhelper-dh-exec/debian/debian/manpages
+++ b/t/tests/debhelper-dh-exec/debian/debian/manpages
@@ -1,2 +1,3 @@
#! /usr/lib/dh-exec/dh-exec-subst
## The above works, but is not recommended.
+foo => bar
diff --git a/t/tests/debhelper-dh-exec/debian/debian/rules b/t/tests/debhelper-dh-exec/debian/debian/rules
index 44e34f9..3038aa9 100755
--- a/t/tests/debhelper-dh-exec/debian/debian/rules
+++ b/t/tests/debhelper-dh-exec/debian/debian/rules
@@ -4,3 +4,5 @@
dh $@
override_dh_installman:
+
+override_dh_install:
diff --git a/t/tests/debhelper-dh-exec/desc b/t/tests/debhelper-dh-exec/desc
index 1bd4dc5..3651100 100644
--- a/t/tests/debhelper-dh-exec/desc
+++ b/t/tests/debhelper-dh-exec/desc
@@ -5,6 +5,7 @@ Options: --suppress-tags
package-needs-versioned-debhelper-build-depends
Description: Tests related to executable, dh-exec using packaging files
Test-For:
+ dh-exec-install-not-allowed-here
dh-exec-private-helper
dh-exec-script-without-dh-exec-features
package-uses-dh-exec-but-lacks-build-depends
diff --git a/t/tests/debhelper-dh-exec/tags b/t/tests/debhelper-dh-exec/tags
index 564ac8c..b40c656 100644
--- a/t/tests/debhelper-dh-exec/tags
+++ b/t/tests/debhelper-dh-exec/tags
@@ -1,3 +1,4 @@
+E: debhelper-dh-exec source: dh-exec-install-not-allowed-here debian/manpages
E: debhelper-dh-exec source: dh-exec-private-helper debian/manpages
E: debhelper-dh-exec source: package-uses-dh-exec-but-lacks-build-depends
-W: debhelper-dh-exec source: dh-exec-script-without-dh-exec-features debian/manpages
+W: debhelper-dh-exec source: dh-exec-script-without-dh-exec-features debian/install
--
Debian package checker
Reply to: