From 32dce36087c35668b74815e0f88eefce250d31a9 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Fri, 17 May 2019 20:19:27 +0000 Subject: dh_perl: Fix code for pruning usr/share/doc Signed-off-by: Niels Thykier --- debian/changelog | 2 ++ dh_perl | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index a27f20bc..712000f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ debhelper (12.1.2) UNRELEASED; urgency=medium value of the last error (if any). * Buildsystem/make: Fix regression where cross-flags were passed in a non-cross build. (Closes: #925175) + * dh_perl: Fix code to prune (skip) /usr/share/doc which + never worked. [ Helmut Grohne ] * Buildsystem/cmake: Fix CMAKE_SYSTEM_PROCESSOR for mips64el. diff --git a/dh_perl b/dh_perl index 36637829..d79b7957 100755 --- a/dh_perl +++ b/dh_perl @@ -109,19 +109,26 @@ foreach my $package (@{$dh{DOPACKAGES}}) { }, @dirs if @dirs; # find scripts - find sub { - return unless -f and (-x _ or /\.pl$/); - if ($File::Find::dir =~ m{/usr/share/doc/}) { - $File::Find::prune = 1 if -d _; + $tmp =~ tr:/:/:s; + $tmp =~ s{[^/]\K/$}{}; + my $usd_dir = "$tmp/usr/share/doc"; + my $check_script = sub { + if ($_ eq $usd_dir) { + $File::Find::prune = 1 if -d $_; return; } + return unless -f and (-x _ or /\.pl$/); return unless open(my $fd, '<', $_); if (read($fd, local $_, 32) and m%^#!\s*(/usr/bin/perl|/usr/bin/env\s+perl)\s%) { $deps |= PROGRAM; } close($fd); - }, $tmp; + }; + find({ + wanted => $check_script, + no_chdir => 1, + }, $tmp); if ($deps) { my $version=""; -- cgit v1.2.3