Merge branch 'multiple-keyrings' into 'master'

Draft: Add support for multiple keyrings

Closes #141

See merge request archlinux/archlinux-keyring!97
This commit is contained in:
Kristian Klausen 2023-08-18 03:29:17 +00:00
commit 996002c363
2 changed files with 15 additions and 0 deletions

View File

@ -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):

View File

@ -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()