1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-22 07:43:09 +00:00

Correctly supply prune pattern for borg >=1.2.2 (#1565)

Adds different behaviour when borg version >=1.2.2 but <2.0.0: The prune pattern is supplied without a style prefix like `sh:`.
Fixes #1564.

---------

Co-authored-by: herrwusel <herrwusel@user.noreply.github.com>
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
This commit is contained in:
herrwusel 2023-02-06 22:02:55 +01:00 committed by GitHub
parent a4ab7e713a
commit ffafcee05c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,8 +47,10 @@ def prepare(cls, profile):
if profile.prune_prefix:
formatted_prune_prefix = format_archive_name(profile, profile.prune_prefix)
if borg_compat.check('V122'):
pruning_opts += ['-a', 'sh:' + formatted_prune_prefix + '*']
if borg_compat.check('V2'):
pruning_opts += ['-a', f"sh:{formatted_prune_prefix}*"]
elif borg_compat.check('V122'):
pruning_opts += ['-a', f"{formatted_prune_prefix}*"]
else:
pruning_opts += ['--prefix', formatted_prune_prefix]