summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2019-05-17 20:19:27 +0000
committerNiels Thykier <niels@thykier.net>2019-05-17 20:19:27 +0000
commit32dce36087c35668b74815e0f88eefce250d31a9 (patch)
treed82e44c9c8cfd01a16778ddf8eef2a21b286b799
parent32f1e3b5150dc893300a4fa74af51a4e23eb9915 (diff)
downloaddebhelper-32dce36087c35668b74815e0f88eefce250d31a9.tar.gz
dh_perl: Fix code for pruning usr/share/doc
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--debian/changelog2
-rwxr-xr-xdh_perl17
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="";