1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-21 23:33:13 +00:00

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

View file

@ -40,7 +40,7 @@ def prepare(cls, profile, archive_name, model: ExtractTree, destination_folder):
# 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 @@ def prepare(cls, profile, archive_name, model: ExtractTree, destination_folder):
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)