[debhelper-devel] [debhelper] 04/09: dh_missing: Refactor sourcedir check

Niels Thykier nthykier at moszumanska.debian.org
Sat Jul 29 19:01:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch easier-multi-builds
in repository debhelper.

commit a9768085ff194ce05a424fb9d4c4dfe914c61df4
Author: Niels Thykier <niels at thykier.net>
Date:   Wed Jul 19 20:15:09 2017 +0000

    dh_missing: Refactor sourcedir check
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 dh_missing | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/dh_missing b/dh_missing
index 68ccaee..f3f1646 100755
--- a/dh_missing
+++ b/dh_missing
@@ -90,12 +90,11 @@ if ($srcdir eq '.') {
 	$srcdir='debian/tmp';
 }
 
-if (! -d $srcdir) {
-	if (scalar(getpackages()) == 1 && not defined($dh{SOURCEDIR})) {
-		warning("$srcdir does not exist and there is only binary package.");
-		warning("Assuming everything is installed directly into the package directory.");
-		exit(0);
-	}
+if (not defined($dh{SOURCEDIR}) and scalar(getpackages()) == 1) {
+	# Special-case where every thing is installed directly into the
+	# package directory.
+	exit(0);
+} elsif (defined($dh{SOURCEDIR}) and not -d $dh{SOURCEDIR}) {
 	if (compat(10)) {
 		# Prevent "dh $@ --list-missing --destdir=..." from failing in compat 10.
 		warning("Cannot check if installation is missing files: $srcdir does not exist");
@@ -103,8 +102,11 @@ if (! -d $srcdir) {
 	} else {
 		error("Cannot check if installation is missing files: $srcdir does not exist");
 	}
+} elsif (not -d $srcdir) {
+	exit(0);
 }
 
+
 for my $file (<debian/.debhelper/generated/*/installed-by-*>) {
 	my ($target_pkg, $helper) = ('unknown', 'unknown');
 	my $had_files = 0;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list