diff options
author | Niels Thykier <niels@thykier.net> | 2017-11-11 09:52:52 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2017-11-11 09:52:54 +0000 |
commit | bda9622d85a5f277cf4aa42b279a30e786bda504 (patch) | |
tree | 733358ef8ffad8e3257d92d8118f7c443b77fe49 /dh_missing | |
parent | d2ace56b996b54d8ba24fcd9af3206d3839cbe57 (diff) | |
download | debhelper-bda9622d85a5f277cf4aa42b279a30e786bda504.tar.gz |
dh_missing: Lazy load File::Find
We do not have a NOOP promise for dh_missing, but we can make it
cheaper for single binary packages by lazy loading the File::Find
module.
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'dh_missing')
-rwxr-xr-x | dh_missing | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -8,7 +8,6 @@ dh_missing - check for missing files use strict; use warnings; -use File::Find; use Debian::Debhelper::Dh_Lib; our $VERSION = DH_BUILTIN_VERSION; @@ -142,7 +141,14 @@ my $installed=join("|", map { "\Q$_\E\/.*|\Q$_\E"; } @installed); $installed=qr{^($installed)$}; -find(sub { + +# Lazy load File::Find +require File::Find; + +File::Find::find(sub { + # Lazy loading of File::Find makes perl think that File::Find::dir is only used once + # and we might have typo'ed something + no warnings qw(once); -f || -l || return; $_="$File::Find::dir/$_"; if (! /$installed/ && ! excludefile($_)) { |