Package: debhelper
Version: 7.2.16
Severity: serious

Hi!

On dh_install, when using compat level >= 7, passing an absolute path
(like “$(CURDIR)/debian/tmp”) to --sourcedir, the first result of the
glob is a dangling symlink (like when it points to another directory,
which then makes it need to be an absolute path, for example
“debian/tmp/usr/lib/libfoo.so” pointing to “/lib/libfoo.so.1”), the
automatic fallback to look into “debian/tmp” makes the destination
path end up in something like “/debian/tmp/<path>”.

Arguably this can be fixed by just dropping the --sourcedir
argument, but still, it breaks the packages pretty badly, thus the
serious severity.

I didn't notice this on few of my packages (libpmount, libaio, etc) on
my build system because I've the shared library packages installed,
which makes the absolute symlinks not be dangling ones.

Attached patch should fix this.

regards,
guillem
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";
 				}
 			}

Reply via email to