|
@@ -46,8 +46,6 @@ def prune_archives(
|
|
|
prune_arguments,
|
|
|
local_path='borg',
|
|
|
remote_path=None,
|
|
|
- stats=False,
|
|
|
- list_archives=False,
|
|
|
):
|
|
|
'''
|
|
|
Given dry-run flag, a local or remote repository path, a storage config dict, and a
|
|
@@ -69,20 +67,21 @@ def prune_archives(
|
|
|
+ (('--remote-path', remote_path) if remote_path else ())
|
|
|
+ (('--umask', str(umask)) if umask else ())
|
|
|
+ (('--lock-wait', str(lock_wait)) if lock_wait else ())
|
|
|
- + (('--stats',) if stats and not dry_run else ())
|
|
|
+ + (('--stats',) if prune_arguments.stats and not dry_run else ())
|
|
|
+ (('--info',) if logger.getEffectiveLevel() == logging.INFO else ())
|
|
|
- + (('--list',) if list_archives else ())
|
|
|
- + (flags.make_flags('newest', prune_arguments.newest) if prune_arguments.newest else ())
|
|
|
- + (flags.make_flags('oldest', prune_arguments.oldest) if prune_arguments.oldest else ())
|
|
|
- + (flags.make_flags('older', prune_arguments.older) if prune_arguments.older else ())
|
|
|
- + (flags.make_flags('newer', prune_arguments.newer) if prune_arguments.newer else ())
|
|
|
+
|
|
|
+ + flags.make_flags_from_arguments(
|
|
|
+ prune_arguments,
|
|
|
+ excludes=('repository', 'stats'),
|
|
|
+ )
|
|
|
+
|
|
|
+ (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
|
|
|
- + (('--dry-run',) if dry_run else ())
|
|
|
+
|
|
|
+ (tuple(extra_borg_options.split(' ')) if extra_borg_options else ())
|
|
|
+ flags.make_repository_flags(repository, local_borg_version)
|
|
|
)
|
|
|
|
|
|
- if stats or list_archives:
|
|
|
+ if prune_arguments.stats or prune_arguments.list_archives:
|
|
|
output_log_level = logging.ANSWER
|
|
|
else:
|
|
|
output_log_level = logging.INFO
|