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

Bug#801104: Anoter useless-use-of-dh-exec check



Attached is another patch, a followup to the previous two. It catches
the 'usr/lib/${DEB_HOST_MULTIARCH}/some-dir/*.so' cases too.

-- 
|8]
>From 577add3f0269411abf378fe461f3c1f4c829678a Mon Sep 17 00:00:00 2001
From: Gergely Nagy <algernon@madhouse-project.org>
Date: Tue, 6 Oct 2015 13:00:11 +0200
Subject: [PATCH 3/3] checks/debhelper.pm: Add another useless use of dh-exec
 check

Catch usr/lib/${DEB_HOST_MULTIARCH}/$stuff cases too. Cases where there
is no explicit destination, and only the dpkg-architecture substitution
variables are used.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
---
 checks/debhelper.pm                             | 3 ++-
 t/tests/debhelper-dh-exec/debian/debian/install | 1 +
 t/tests/debhelper-dh-exec/tags                  | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/checks/debhelper.pm b/checks/debhelper.pm
index db00b5a..a896eb9 100644
--- a/checks/debhelper.pm
+++ b/checks/debhelper.pm
@@ -503,7 +503,8 @@ sub _check_dh_exec {
         $dhe_filter = 1 if /<[^>]+>/;
 
         if (/^usr\/lib\/\$\{([^\}]+)\}\/?$/ ||
-            /^usr\/lib\/\$\{([^\}]+)\}\/?\s+\/usr\/lib\/\$\{([^\}]+)\}\/?$/) {
+            /^usr\/lib\/\$\{([^\}]+)\}\/?\s+\/usr\/lib\/\$\{([^\}]+)\}\/?$/ ||
+            /^usr\/lib\/\$\{([^\}]+)\}[^\s]+$/) {
             my $sv = $1;
             my $dv = $2;
             my $dhe_useless = 0;
diff --git a/t/tests/debhelper-dh-exec/debian/debian/install b/t/tests/debhelper-dh-exec/debian/debian/install
index 50055cb..c79e8ae 100755
--- a/t/tests/debhelper-dh-exec/debian/debian/install
+++ b/t/tests/debhelper-dh-exec/debian/debian/install
@@ -3,3 +3,4 @@ usr/lib/foo [linux-any] [hurd-any] [kfreebsd-any]
 usr/lib/${DEB_HOST_MULTIARCH}
 usr/lib/${DEB_HOST_MULTIARCH} /usr/lib/${DEB_HOST_MULTIARCH}/
 usr/lib/${DEB_BUILD_MULTIARCH} /usr/lib/${DEB_HOST_MULTIARCH}/
+usr/lib/${DEB_HOST_MULTIARCH}/some-package/*.so
diff --git a/t/tests/debhelper-dh-exec/tags b/t/tests/debhelper-dh-exec/tags
index 50d5f12..6d45ebe 100644
--- a/t/tests/debhelper-dh-exec/tags
+++ b/t/tests/debhelper-dh-exec/tags
@@ -4,4 +4,5 @@ E: debhelper-dh-exec source: package-uses-dh-exec-but-lacks-build-depends
 I: debhelper-dh-exec source: dh-exec-subst-unknown-variable debian/manpages DEB_BUILD_WHATEVER
 I: debhelper-dh-exec source: dh-exec-useless-usage debian/install "usr/lib/${DEB_HOST_MULTIARCH} /usr/lib/${DEB_HOST_MULTIARCH}/"
 I: debhelper-dh-exec source: dh-exec-useless-usage debian/install "usr/lib/${DEB_HOST_MULTIARCH}"
+I: debhelper-dh-exec source: dh-exec-useless-usage debian/install "usr/lib/${DEB_HOST_MULTIARCH}/some-package/*.so"
 W: debhelper-dh-exec source: dh-exec-script-without-dh-exec-features debian/dirs
-- 
2.5.3


Reply to: