Skip to content

Commit

Permalink
Use pf pattern format for extract. By @real-yfprojects (#1625)
Browse files Browse the repository at this point in the history
* src/vorta/borg/extract.py : The pattern file passed to borg now contains `pf`-style patterns for included paths.
  • Loading branch information
real-yfprojects authored Apr 5, 2023
1 parent 6d5e738 commit 828e029
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vorta/borg/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 828e029

Please sign in to comment.