From 80d4449eb6cd125ca355842ebd03890e907bc5df Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 25 Mar 2025 08:21:54 +0000 Subject: [PATCH] sys-auth/polkit: handle USE=-daemon in pkg_postinst Closes: https://bugs.gentoo.org/952019 Signed-off-by: Sam James --- sys-auth/polkit/polkit-126-r1.ebuild | 10 ++++++---- sys-auth/polkit/polkit-9999.ebuild | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/sys-auth/polkit/polkit-126-r1.ebuild b/sys-auth/polkit/polkit-126-r1.ebuild index 896f29b6aefc5..d3d5ee6aac976 100644 --- a/sys-auth/polkit/polkit-126-r1.ebuild +++ b/sys-auth/polkit/polkit-126-r1.ebuild @@ -154,10 +154,12 @@ src_install() { } pkg_postinst() { - tmpfiles_process polkit-tmpfiles.conf + if use daemon ; then + tmpfiles_process polkit-tmpfiles.conf - if use daemon && [[ ${EUID} == 0 ]]; then - chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d - chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d + if [[ ${EUID} == 0 ]]; then + chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d + chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d + fi fi } diff --git a/sys-auth/polkit/polkit-9999.ebuild b/sys-auth/polkit/polkit-9999.ebuild index b9a851389923b..d3d5ee6aac976 100644 --- a/sys-auth/polkit/polkit-9999.ebuild +++ b/sys-auth/polkit/polkit-9999.ebuild @@ -83,6 +83,12 @@ QA_MULTILIB_PATHS=" usr/lib/polkit-1/polkitd " +PATCHES=( + "${FILESDIR}"/${P}-elogind.patch + "${FILESDIR}"/${P}-realpath.patch + "${FILESDIR}"/${P}-musl.patch +) + python_check_deps() { python_has_version "dev-python/dbus-python[${PYTHON_USEDEP}]" && python_has_version "dev-python/python-dbusmock[${PYTHON_USEDEP}]" @@ -148,10 +154,12 @@ src_install() { } pkg_postinst() { - tmpfiles_process polkit-tmpfiles.conf + if use daemon ; then + tmpfiles_process polkit-tmpfiles.conf - if use daemon && [[ ${EUID} == 0 ]]; then - chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d - chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d + if [[ ${EUID} == 0 ]]; then + chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d + chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d + fi fi }