From 77e5b368726f40a3b265ea63bc1ade1589c71ae6 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Thu, 21 Oct 2021 21:03:02 +0200 Subject: [PATCH] feature(keyringctl): add force parameter to keyring_merge --- keyringctl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/keyringctl b/keyringctl index 4e25b3a..ccdac26 100755 --- a/keyringctl +++ b/keyringctl @@ -643,7 +643,7 @@ def keyring_split(working_dir: Path, keyring: Path) -> Iterable[Path]: return keyrings -def keyring_merge(certificates: List[Path], output: Optional[Path] = None) -> str: +def keyring_merge(certificates: List[Path], output: Optional[Path] = None, force: bool = False) -> str: """Merge multiple certificates into a keyring Parameters @@ -652,6 +652,8 @@ def keyring_merge(certificates: List[Path], output: Optional[Path] = None) -> st List of paths to certificates to merge into a keyring output: Optional[Path] Path to a file which the keyring is written, return the result instead if None + force: bool + Whether to force overwriting existing files (defaults to False) Returns ------- @@ -660,6 +662,8 @@ def keyring_merge(certificates: List[Path], output: Optional[Path] = None) -> st """ cmd = ["sq", "keyring", "merge"] + if force: + cmd.insert(1, "--force") if output: cmd += ["--output", str(output)] cmd += [str(cert) for cert in sorted(certificates)] @@ -702,7 +706,7 @@ def packet_join(packets: List[Path], output: Optional[Path] = None, force: bool output: Optional[Path] Path to a file to which all PGP packet data is written, return the result instead if None force: bool - Whether to force the execution of sq (defaults to False) + Whether to force overwriting existing files (defaults to False) Returns -------