From dd3c0429fe16b560f6308bbfb5635cbfacda38d5 Mon Sep 17 00:00:00 2001 From: derrod Date: Thu, 17 Jun 2021 15:08:31 +0200 Subject: [PATCH] [cli] Filter files by install tag before verifying --- legendary/cli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/legendary/cli.py b/legendary/cli.py index 9c3f613..5704d5e 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -800,7 +800,16 @@ class LegendaryCLI: key=lambda a: a.filename.lower()) # build list of hashes - file_list = [(f.filename, f.sha_hash.hex()) for f in files] + if config_tags := self.core.lgd.config.get(args.app_name, 'install_tags', fallback=None): + install_tags = set(i.strip() for i in config_tags.split(',')) + file_list = [ + (f.filename, f.sha_hash.hex()) + for f in files + if any(it in install_tags for it in f.install_tags) or not f.install_tags + ] + else: + file_list = [(f.filename, f.sha_hash.hex()) for f in files] + total = len(file_list) num = 0 failed = []