Use `pf` pattern format for extract. By @real-yfprojects (#1625)

* src/vorta/borg/extract.py : The pattern file passed to borg now contains `pf`-style patterns for included paths.
This commit is contained in:
yfprojects 2023-04-05 11:08:06 +00:00 committed by GitHub
parent 6d5e738107
commit 828e02953b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class BorgExtractJob(BorgJob):
# Unselected (and excluded) parent folders will be restored by borg
# but without the metadata stored in the archive.
pattern_file = tempfile.NamedTemporaryFile('w', delete=True)
pattern_file.write("P fm\n")
pattern_file.write("P pf\n")
indexes = [QModelIndex()]
while indexes:
@ -54,7 +54,7 @@ class BorgExtractJob(BorgJob):
if item.data.checkstate == Qt.CheckState.Checked:
pattern_file.write("+ " + path_to_str(item.path) + "\n")
pattern_file.write("- *\n")
pattern_file.write("- fm:*\n")
pattern_file.flush()
cmd.extend(['--patterns-from', pattern_file.name])
ret['cleanup_files'].append(pattern_file)