1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-23 14:41:43 +00:00

enable placeholder usage in all extra archive arguments

This commit is contained in:
Elmar Hoffmann 2019-06-23 02:03:04 +02:00
parent 47fa7a83a7
commit a26065064d
2 changed files with 3 additions and 4 deletions

View file

@ -1071,8 +1071,7 @@ def print_output(diff, path):
@with_archive
def do_rename(self, args, repository, manifest, key, cache, archive):
"""Rename an existing archive"""
name = replace_placeholders(args.name)
archive.rename(name)
archive.rename(args.name)
manifest.write()
repository.commit(compact=False)
cache.commit()
@ -1545,11 +1544,10 @@ def do_recreate(self, args, repository, manifest, key, cache):
if args.location.archive:
name = args.location.archive
target = replace_placeholders(args.target) if args.target else None
if recreater.is_temporary_archive(name):
self.print_error('Refusing to work on temporary archive of prior recreate: %s', name)
return self.exit_code
if not recreater.recreate(name, args.comment, target):
if not recreater.recreate(name, args.comment, args.target):
self.print_error('Nothing to do. Archive was not processed.\n'
'Specify at least one pattern, PATH, --comment, re-compression or re-chunking option.')
else:

View file

@ -498,6 +498,7 @@ def validator(text):
def archivename_validator():
def validator(text):
text = replace_placeholders(text)
if '/' in text or '::' in text or not text:
raise argparse.ArgumentTypeError('Invalid repository name: "%s"' % text)
return text