aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2023-06-13 04:00:58 +0800
committerKunoiSayami <[email protected]>2023-06-13 04:00:58 +0800
commit3606da1098d166b4597102ae261bf6e9e8b15305 (patch)
treeca37d88e7370d6ab26d75b14efcb54b8d51b0f34 /utils
parentbe6037c6685895909b06c779c3688df1dfc372f5 (diff)
feat(script): Kill gpg agent after process done
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/update-db.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/update-db.py b/utils/update-db.py
index 71da6f8..536d745 100755
--- a/utils/update-db.py
+++ b/utils/update-db.py
@@ -28,6 +28,10 @@ async def add_package(dest: pathlib.Path, pkg_name: str, key: str) -> None:
).wait()
+async def kill_gpg_agnet() -> None:
+ await asyncio.create_subprocess_exec("/usr/bin/gpg-connect-agent", 'killagent', '/bye')
+
+
async def main(remote_dest: str, repo_base_name: str, sign_key: str) -> None:
cwd = pathlib.Path(os.getcwd()).resolve()
remote_dest = pathlib.Path(remote_dest).resolve()
@@ -40,6 +44,8 @@ async def main(remote_dest: str, repo_base_name: str, sign_key: str) -> None:
for file in os.listdir(str(remote_dest)):
if ".pkg.tar.zst" in file and not file.endswith(".sig"):
await add_package(database_dest, file, sign_key)
+
+ await kill_gpg_agnet()
if __name__ == "__main__":