commit:     80d4449eb6cd125ca355842ebd03890e907bc5df
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 25 08:21:54 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 25 08:22:06 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80d4449e

sys-auth/polkit: handle USE=-daemon in pkg_postinst

Closes: https://bugs.gentoo.org/952019
Signed-off-by: Sam James <sam <AT> gentoo.org>

 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 896f29b6aefc..d3d5ee6aac97 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 b9a851389923..d3d5ee6aac97 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
 }

Reply via email to