App-BorgRestore
view release on metacpan or search on metacpan
lib/App/BorgRestore/PathTimeTable/DB.pm view on Meta::CPAN
# add any files/directories to the database. If the new path is a subpath
# (substring actually) of the cached path, we can keep it only in the cache
# and no flush is needed. Otherwise we need to flush all parts of the path
# that are no longer contained in the new path.
#
# We start by checking the currently cached path ($old_cache_path) against
# the new $path. Then we remove one part from the path at a time, until we
# reach a parent path (directory) of $path.
$log->tracef("Checking if cache invalidation is required") if TRACE;
while ((my $slash_index = rindex($old_cache_path, "/")) != -1) {
$self->{stats}->{cache_invalidation_loop_iterations}++;
# Directories in the borg output cannot be differentiated by their
# path, since their path looks just like a file path. I.e. there is no
# directory separator (/) at the end of a directory path.
#
# Since we want to keep any directory in our cache, if it contains
# $path, we can treat any cached path as a directory path. If the
# cached path was really a directory, the new $path will also contain a
# directory separator (/) between the old cached path (the parent
# directory) and the new path (a subdirectory or a file in the
# directory). If the cached path was not actually a directory,
( run in 1.456 second using v1.01-cache-2.11-cpan-96521ef73a4 )