[debhelper-devel] [debhelper] 01/01: dh_perl: Prune usr/share/doc directory in File::Find

Niels Thykier nthykier at moszumanska.debian.org
Sat Oct 28 12:52:41 UTC 2017


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

nthykier pushed a commit to branch master
in repository debhelper.

commit 082c71b5341fd4b5e12ccb4ce9a438921f85ffad
Author: Niels Thykier <niels at thykier.net>
Date:   Sat Oct 28 12:50:46 2017 +0000

    dh_perl: Prune usr/share/doc directory in File::Find
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog | 2 ++
 dh_perl          | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 3276604..1ca4227 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ debhelper (10.10.6) UNRELEASED; urgency=medium
     entries.
   * Use HTTPS in debian/copyright format URL.
   * Remove support for named compat levels.
+  * dh_perl: Make dh_perl faster on packages with large doc
+    directories by pruning the entire doc directory.
 
  -- Axel Beckert <abe at debian.org>  Fri, 27 Oct 2017 23:48:44 +0200
 
diff --git a/dh_perl b/dh_perl
index 8e1e603..3663782 100755
--- a/dh_perl
+++ b/dh_perl
@@ -111,7 +111,10 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	# find scripts
 	find sub {
 		return unless -f and (-x _ or /\.pl$/);
-		return if $File::Find::dir=~/\/usr\/share\/doc\//;
+		if ($File::Find::dir =~ m{/usr/share/doc/}) {
+			$File::Find::prune = 1 if -d _;
+			return;
+		}
 
 		return unless open(my $fd, '<', $_);
 		if (read($fd, local $_, 32) and m%^#!\s*(/usr/bin/perl|/usr/bin/env\s+perl)\s%) {

-- 
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