diff options
author | Niels Thykier <niels@thykier.net> | 2017-11-11 08:08:29 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2017-11-11 08:08:29 +0000 |
commit | 0ff7d9c44b153c5536cb43a71a34bc35154b026b (patch) | |
tree | 1db7ea43daa02a6c580677718cfdab08b9d2b3b1 | |
parent | bb73623fcf1775b6c5f9de0838e4f33f8caa18c5 (diff) | |
download | debhelper-0ff7d9c44b153c5536cb43a71a34bc35154b026b.tar.gz |
Replace some string evals with a simple require
Signed-off-by: Niels Thykier <niels@thykier.net>
-rwxr-xr-x | dh | 2 | ||||
-rw-r--r-- | lib/Debian/Debhelper/Dh_Lib.pm | 8 | ||||
-rwxr-xr-x | t/pod.t | 2 |
3 files changed, 6 insertions, 6 deletions
@@ -540,7 +540,7 @@ sub list_addons { my %addons; for my $inc (@INC) { - eval q{use File::Spec}; + require File::Spec; my $path = File::Spec->catdir($inc, "Debian/Debhelper/Sequence"); if (-d $path) { for my $module_path (glob "$path/*.pm") { diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm index 8f605a7d..04e94a65 100644 --- a/lib/Debian/Debhelper/Dh_Lib.pm +++ b/lib/Debian/Debhelper/Dh_Lib.pm @@ -113,7 +113,7 @@ sub init { if ((defined $ENV{DH_OPTIONS} && length $ENV{DH_OPTIONS}) || (defined $ENV{DH_INTERNAL_OPTIONS} && length $ENV{DH_INTERNAL_OPTIONS}) || grep /^-/, @ARGV) { - eval "use Debian::Debhelper::Dh_Getopt"; + eval { require Debian::Debhelper::Dh_Getopt; }; error($@) if $@; Debian::Debhelper::Dh_Getopt::parseopts(%params); } @@ -1798,12 +1798,12 @@ sub cross_command { # variable and returns the computed value. sub get_source_date_epoch { return $ENV{SOURCE_DATE_EPOCH} if exists($ENV{SOURCE_DATE_EPOCH}); - eval "use Dpkg::Changelog::Debian"; + eval { require Dpkg::Changelog::Debian }; if ($@) { warning "unable to set SOURCE_DATE_EPOCH: $@"; return; } - eval "use Time::Piece"; + eval { require Time::Piece }; if ($@) { warning "unable to set SOURCE_DATE_EPOCH: $@"; return; @@ -1835,7 +1835,7 @@ sub set_buildflags { # rely on this [CVE-2016-1238] $ENV{PERL_USE_UNSAFE_INC} = 1 if compat(10); - eval "use Dpkg::BuildFlags"; + eval { require Dpkg::BuildFlags }; if ($@) { warning "unable to load build flags: $@"; return; @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More; -eval 'use Test::Pod'; +eval { require Test::Pod; Test::Pod->import; }; plan skip_all => 'Test::Pod required' if $@; all_pod_files_ok('debhelper.pod', grep { -x $_ } 'dh', glob 'dh_*'); |