diff options
author | Michał Górny <mgorny@gentoo.org> | 2023-01-22 11:32:48 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2023-01-22 11:32:48 +0100 |
commit | 6f26619042e9b134710f9e10feec26e2bd887f36 (patch) | |
tree | c68037d61e71bf8180c69b9d5ba7b9eab039d7a9 | |
parent | 75d3b7abba57ed5099b302ccbba506d8f175bc9d (diff) | |
download | gemato-6f26619042e9b134710f9e10feec26e2bd887f36.tar.gz |
cli: Add --no-require-all-good to openpgp-verify command
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r-- | gemato/cli.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gemato/cli.py b/gemato/cli.py index 6ecf017..da0487a 100644 --- a/gemato/cli.py +++ b/gemato/cli.py @@ -1,5 +1,5 @@ # gemato: CLI routines -# (c) 2017-2022 Michał Górny +# (c) 2017-2023 Michał Górny # Licensed under the terms of 2-clause BSD license @@ -544,6 +544,12 @@ class OpenPGPVerifyCommand(VerifyingOpenPGPMixin, GematoCommand): super().add_options(subp) subp.add_argument( + "--no-require-all-good", + dest="require_all_good", + action="store_false", + default=True, + help="Require only one good signature on multi-signature files") + subp.add_argument( 'paths', nargs='*', default=['-'], help='Paths to hash (defaults to "-" (stdin) if not ' 'specified)') @@ -552,6 +558,7 @@ class OpenPGPVerifyCommand(VerifyingOpenPGPMixin, GematoCommand): super().parse_args(args, argp) self.paths = args.paths + self.require_all_good = args.require_all_good def __call__(self): super().__call__() @@ -566,7 +573,8 @@ class OpenPGPVerifyCommand(VerifyingOpenPGPMixin, GematoCommand): try: try: - sig = self.openpgp_env.verify_file(f) + sig = self.openpgp_env.verify_file( + f, require_all_good=self.require_all_good) except GematoException as e: logging.error( f'OpenPGP verification failed for {p}:\n{e}') |