summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/App/BorgRestore/Borg.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/App/BorgRestore/Borg.pm b/lib/App/BorgRestore/Borg.pm
index bd9ac3c..3e531ba 100644
--- a/lib/App/BorgRestore/Borg.pm
+++ b/lib/App/BorgRestore/Borg.pm
@@ -107,7 +107,14 @@ method restore($components_to_strip, $archive_name, $path) {
method list_archive($archive, $cb) {
$log->debugf("Fetching file list for archive %s", $archive);
- open (my $fh, '-|', 'borg', qw/list --list-format/, '{isomtime} {path}{NEWLINE}', $self->{borg_repo}."::".$archive);
+ my $fh;
+
+ if (Version::Compare::version_compare($self->{borg_version}, "1.1") >= 0) {
+ open ($fh, '-|', 'borg', qw/list --format/, '{isomtime} {path}{NEWLINE}', $self->{borg_repo}."::".$archive);
+ } else {
+ open ($fh, '-|', 'borg', qw/list --list-format/, '{isomtime} {path}{NEWLINE}', $self->{borg_repo}."::".$archive);
+ }
+
while (<$fh>) {
$cb->($_);
}