summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2017-11-11 08:08:29 +0000
committerNiels Thykier <niels@thykier.net>2017-11-11 08:08:29 +0000
commit0ff7d9c44b153c5536cb43a71a34bc35154b026b (patch)
tree1db7ea43daa02a6c580677718cfdab08b9d2b3b1
parentbb73623fcf1775b6c5f9de0838e4f33f8caa18c5 (diff)
downloaddebhelper-0ff7d9c44b153c5536cb43a71a34bc35154b026b.tar.gz
Replace some string evals with a simple require
Signed-off-by: Niels Thykier <niels@thykier.net>
-rwxr-xr-xdh2
-rw-r--r--lib/Debian/Debhelper/Dh_Lib.pm8
-rwxr-xr-xt/pod.t2
3 files changed, 6 insertions, 6 deletions
diff --git a/dh b/dh
index d492f285..3d268268 100755
--- a/dh
+++ b/dh
@@ -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;
diff --git a/t/pod.t b/t/pod.t
index 755fb818..444eed25 100755
--- a/t/pod.t
+++ b/t/pod.t
@@ -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_*');