summaryrefslogtreecommitdiff
path: root/bin/locmaint
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-02-09 12:32:47 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-02-09 12:32:47 -0700
commitf361945bd5cdb48b72879bdb66aa37555993f6be (patch)
tree1311a2a3a9c78fd1676696a95fefce23d33cd0cc /bin/locmaint
parent3b3f39226729c27154bc653408e0b7e6d55f96c9 (diff)
downloaddotfiles-f361945bd5cdb48b72879bdb66aa37555993f6be.tar.gz
avoid string eval
Diffstat (limited to 'bin/locmaint')
-rwxr-xr-xbin/locmaint6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/locmaint b/bin/locmaint
index ee05ea2c..a1dcb1a6 100755
--- a/bin/locmaint
+++ b/bin/locmaint
@@ -279,7 +279,8 @@ sub do_homedir {
sub do_coldbkup {
my $root = shift;
- return unless eval "use Git::Wrapper; use Net::GitHub; 1";
+ return
+ unless eval { require Git::Wrapper } and eval { require Net::GitHub };
my $short = basename($root);
my $gitbk = catfile($root, "gitbk");
@@ -380,7 +381,8 @@ sub do_coldbkup {
}
sub do_workstation_duplicity {
- return unless eval "use Date::Manip; 1";
+ return unless eval { require Date::Manip };
+ Date::Manip->import;
my $profile = hostname() . "-" . getpwuid($<) . "-home";
return unless -e "$ENV{HOME}/.duply/$profile/conf";