summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-11-22 12:13:43 +0100
committerFlorian Pritz <bluewind@xinu.at>2017-11-22 12:13:43 +0100
commit0b7c809d2680fdb1d4dd17eec296fa3fe0a42c14 (patch)
tree838bf7c77c9e931f665c117b6f4958adf757d60b
parent0db2d2145810e93801dd77f5f016647a606e1f73 (diff)
downloadApp-BorgRestore-0b7c809d2680fdb1d4dd17eec296fa3fe0a42c14.tar.gz
App-BorgRestore-0b7c809d2680fdb1d4dd17eec296fa3fe0a42c14.tar.xz
Replace File::* dependencies with Path::Tiny
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--META.json1
-rw-r--r--cpanfile1
-rw-r--r--lib/App/BorgRestore.pm8
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());