Add support for multiple keyrings

We want all @archlinux.org keys in one place, so they can all be
exported to WKD (). This commit adds basic support for the expected
keyrings we need in the short term (support staff and service accounts
(ex: @renovate)).

Fix 
This commit is contained in:
Kristian Klausen 2022-06-11 13:28:41 +02:00
parent a511e5a91a
commit 91f9ebb25b
No known key found for this signature in database
GPG Key ID: E2BE346E410366C3
2 changed files with 15 additions and 0 deletions
libkeyringctl

@ -15,6 +15,7 @@ from .keyring import convert
from .keyring import export
from .keyring import inspect_keyring
from .keyring import list_keyring
from .types import Keyring
from .types import TrustFilter
from .util import absolute_path
from .util import cwd
@ -32,6 +33,12 @@ parser.add_argument(
default=False,
help="force the execution of subcommands (e.g. overwriting of files)",
)
parser.add_argument(
"--keyring",
choices=[e.value for e in Keyring],
default=Keyring.packager.value,
help="Keyring to use",
)
subcommands = parser.add_subparsers(dest="subcommand")
convert_parser = subcommands.add_parser(
@ -143,6 +150,8 @@ def main() -> None: # noqa: ignore=C901
with TemporaryDirectory(prefix="arch-keyringctl-") as tempdir:
project_root = Path(".").absolute()
keyring_root = Path("keyring").absolute()
if args.keyring != "packager":
keyring_root = Path(args.keyring).absolute()
working_dir = Path(tempdir)
debug(f"Working directory: {working_dir}")
with cwd(working_dir):

@ -10,6 +10,12 @@ Username = NewType("Username", str)
PacketKind = NewType("PacketKind", str)
class Keyring(Enum):
packager = "packager"
support = "support"
service = "service"
class Trust(Enum):
unknown = auto
revoked = auto()