From 35a3a6adfbdd43d951e492516738144bfba52238 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 3 Jul 2017 00:54:53 +0200 Subject: [PATCH] prune: do globbing in Archives.list --- src/borg/archiver.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index b76bbf07d..c268c59b5 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -1474,12 +1474,9 @@ class Archiver: '"keep-secondly", "keep-minutely", "keep-hourly", "keep-daily", ' '"keep-weekly", "keep-monthly" or "keep-yearly" settings must be specified.') return self.exit_code - archives_checkpoints = manifest.archives.list(sort_by=['ts'], reverse=True) # just a ArchiveInfo list if args.prefix: args.glob_archives = args.prefix + '*' - if args.glob_archives: - regex = re.compile(shellpattern.translate(args.glob_archives)) - archives_checkpoints = [arch for arch in archives_checkpoints if regex.match(arch.name) is not None] + archives_checkpoints = manifest.archives.list(glob=args.glob_archives, sort_by=['ts'], reverse=True) is_checkpoint = re.compile(r'\.checkpoint(\.\d+)?$').search checkpoints = [arch for arch in archives_checkpoints if is_checkpoint(arch.name)] # keep the latest checkpoint, if there is no later non-checkpoint archive