summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changes1
-rw-r--r--lib/App/BorgRestore/Borg.pm9
2 files changed, 9 insertions, 1 deletions
diff --git a/Changes b/Changes
index 0fa7341..8d12e49 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Revision history for Perl extension App-BorgRestore
{{$NEXT}}
+ - Fix deprecation warning with borg 1.2.x
3.4.4 2020-10-14T12:37:04Z
- Require DBD::SQLite 1.60 or newer to fix issues with schema migration 2
diff --git a/lib/App/BorgRestore/Borg.pm b/lib/App/BorgRestore/Borg.pm
index 04ad89c..9884b21 100644
--- a/lib/App/BorgRestore/Borg.pm
+++ b/lib/App/BorgRestore/Borg.pm
@@ -55,7 +55,14 @@ method borg_list() {
my @archives;
my $backup_prefix = $self->{backup_prefix};
- if (Version::Compare::version_compare($self->{borg_version}, "1.1") >= 0) {
+ if (Version::Compare::version_compare($self->{borg_version}, "1.2") >= 0) {
+ $log->debug("Getting archive list via json");
+ run [qw(borg list --glob-archives), "$backup_prefix*", qw(--json), $self->{borg_repo}], '>', \my $output or die $log->error("borg list returned $?")."\n";
+ my $json = decode_json($output);
+ for my $archive (@{$json->{archives}}) {
+ push @archives, $archive->{archive};
+ }
+ } elsif (Version::Compare::version_compare($self->{borg_version}, "1.1") >= 0) {
$log->debug("Getting archive list via json");
run [qw(borg list --prefix), $backup_prefix, qw(--json), $self->{borg_repo}], '>', \my $output or die $log->error("borg list returned $?")."\n";
my $json = decode_json($output);