Package: debhelper
Version: 7.0.0
Author: Guillem Jover <guillem@debian.org>
Status: applied
Debbug: 534565
Description:
 When using an argument in --sourcedir that makes the glob match the
 filenames from foo.install but is not equal to ‘debian/tmp’, and the
 first result of that glob is a dangling symlink then the destination
 package path ends up including ‘debian/tmp’.


diff --git a/dh_install b/dh_install
index 5a3a7f5..3aa748a 100755
--- a/dh_install
+++ b/dh_install
@@ -153,7 +153,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 			my @found = glob "$srcdir/$glob";
 			if (! compat(6)) {
 				# Fall back to looking in debian/tmp.
-				if (! @found || ! -e $found[0]) {
+				if (! @found || ! (-e $found[0] || -l $found[0])) {
 					@found = glob "debian/tmp/$glob";
 				}
 			}
