summaryrefslogtreecommitdiffstats
path: root/lib/App/BorgRestore.pm
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-01-24 01:10:15 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-01-24 01:10:15 +0100
commitd28bcb7e09769e6eaf9e4e9f0206fdc9e76a575a (patch)
treea5ea3f8bc80e94cec074f5f12107835e163db936 /lib/App/BorgRestore.pm
parentff87476fe745ecafcafe779241469b5617831c27 (diff)
downloadApp-BorgRestore-d28bcb7e09769e6eaf9e4e9f0206fdc9e76a575a.tar.gz
App-BorgRestore-d28bcb7e09769e6eaf9e4e9f0206fdc9e76a575a.tar.xz
Add --list feature to search for files contained in backups by path
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib/App/BorgRestore.pm')
-rw-r--r--lib/App/BorgRestore.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm
index 828838c..c3b37fd 100644
--- a/lib/App/BorgRestore.pm
+++ b/lib/App/BorgRestore.pm
@@ -402,6 +402,21 @@ method _add_path_to_hash($hash, $path, $time) {
}
}
+=head3 search_path
+
+ my $paths = $app->search_path($pattern)
+
+Returns a arrayref of paths that match the pattern. The pattern is matched as
+an sqlite LIKE pattern. If no % occurs in the pattern, the patterns is
+automatically wrapped between two % so it may match anywhere in the path.
+
+=cut
+
+method search_path($pattern) {
+ $pattern = '%'.$pattern.'%' if $pattern !~ m/%/;
+ return $self->{db}->search_path($pattern);
+}
+
=head3 get_missing_items
my $items = $app->get_missing_items($have, $want);