diff options
author | Florian Pritz <bluewind@xinu.at> | 2020-09-27 15:49:17 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2020-09-27 15:49:17 +0200 |
commit | f0dd3fd59afac321317d3b52a36d179b4ea504f7 (patch) | |
tree | 34f9d9aa176ef4b1b03a639c8960b6ec64d8f44c /lib | |
parent | 2e1b4a72b7800fc5f9197a352872eb2975ad70b6 (diff) | |
download | App-BorgRestore-f0dd3fd59afac321317d3b52a36d179b4ea504f7.tar.gz App-BorgRestore-f0dd3fd59afac321317d3b52a36d179b4ea504f7.tar.xz |
DB: Fix incorrect subpath handling for path that is a superstring of the
previous path for top level paths
Same issue as 62f5bc3ce90fedb396d103caae68dc2f211f1b16 except that this
time it is the for top level paths (`/lib` and `/lib64`) which are
handled outside the loop.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/BorgRestore/PathTimeTable/DB.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/App/BorgRestore/PathTimeTable/DB.pm b/lib/App/BorgRestore/PathTimeTable/DB.pm index f92d24c..069d991 100644 --- a/lib/App/BorgRestore/PathTimeTable/DB.pm +++ b/lib/App/BorgRestore/PathTimeTable/DB.pm @@ -100,9 +100,10 @@ method add_path($path, $time) { } $log->tracef("Cache invalidation complete") if TRACE; - if ($old_cache_path ne substr($path, 0, length($old_cache_path))) { + my $cache_check_path = $old_cache_path.'/'; + if ($cache_check_path ne substr($path, 0, length($cache_check_path))) { # ensure that top level directory is also written - $self->_add_path_to_db($self->{archive_id}, $old_cache_path, $self->{cache}->{$old_cache_path}) unless $old_cache_path eq "."; + $self->_add_path_to_db($self->{archive_id}, $old_cache_path, $self->{cache}->{$old_cache_path}) unless ($old_cache_path eq "." or $old_cache_path eq ''); } my $cached = $self->{cache}->{$path}; |