From 0b7c809d2680fdb1d4dd17eec296fa3fe0a42c14 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 22 Nov 2017 12:13:43 +0100 Subject: Replace File::* dependencies with Path::Tiny Signed-off-by: Florian Pritz --- META.json | 1 - cpanfile | 1 - lib/App/BorgRestore.pm | 8 +++----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/META.json b/META.json index 8a17947..9f5e8b9 100644 --- a/META.json +++ b/META.json @@ -46,7 +46,6 @@ "DBD::SQLite" : "0", "DBI" : "0", "Date::Parse" : "0", - "File::Temp" : "0", "File::pushd" : "0", "Function::Parameters" : "0", "Getopt::Long" : "0", diff --git a/cpanfile b/cpanfile index 82a5c73..58c6a0e 100644 --- a/cpanfile +++ b/cpanfile @@ -1,7 +1,6 @@ requires 'DBD::SQLite'; requires 'DBI'; requires 'Path::Tiny'; -requires 'File::Temp'; requires 'File::pushd'; requires 'Function::Parameters'; requires 'Getopt::Long'; diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm index d96b957..68f12ff 100644 --- a/lib/App/BorgRestore.pm +++ b/lib/App/BorgRestore.pm @@ -13,10 +13,8 @@ use App::BorgRestore::Settings; use autodie; use Carp; use Cwd qw(abs_path getcwd); -use File::Basename; +use Path::Tiny; use File::pushd; -use File::Spec; -use File::Temp; use Function::Parameters; use Getopt::Long; use List::Util qw(any all); @@ -130,7 +128,7 @@ Returns an absolute path for a given path. =cut method resolve_relative_path($path) { - my $canon_path = File::Spec->canonpath($path); + my $canon_path = path($path)->canonpath; my $abs_path = abs_path($canon_path); if (!defined($abs_path)) { @@ -336,7 +334,7 @@ method restore($path, $archive, $destination) { $log->infof("Restoring %s to %s from archive %s", $path, $destination, $archive->{archive}); - my $basename = basename($path); + my $basename = path($path)->basename; my $components_to_strip =()= $path =~ /\//g; $log->debugf("CWD is %s", getcwd()); -- cgit v1.2.3-24-g4f1b