From: Zbigniew Jędrzejewski-Szmek Date: Fri, 16 Feb 2024 17:10:45 +0000 (+0100) Subject: rpm: use Path.as_uri() in one more place X-Git-Tag: v21~48^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2398%2Fhead;p=thirdparty%2Fmkosi.git rpm: use Path.as_uri() in one more place --- diff --git a/mkosi/installer/rpm.py b/mkosi/installer/rpm.py index cac43b563..18da69cc1 100644 --- a/mkosi/installer/rpm.py +++ b/mkosi/installer/rpm.py @@ -20,13 +20,11 @@ class RpmRepository(NamedTuple): def find_rpm_gpgkey(context: Context, key: str) -> Optional[str]: - gpgpath = next((context.config.tools() / "usr/share/distribution-gpg-keys").rglob(key), None) - if gpgpath: - return f"file://{Path('/') / gpgpath.relative_to(context.config.tools())}" + if gpgpath := next((context.config.tools() / "usr/share/distribution-gpg-keys").rglob(key), None): + return ('/' / gpgpath.relative_to(context.config.tools())).as_uri() - gpgpath = next(Path(context.pkgmngr / "etc/pki/rpm-gpg").rglob(key), None) - if gpgpath: - return f"file://{Path('/') / gpgpath.relative_to(context.pkgmngr)}" + if gpgpath := next(Path(context.pkgmngr / "etc/pki/rpm-gpg").rglob(key), None): + return ('/' / gpgpath.relative_to(context.pkgmngr)).as_uri() return None