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

Closes: https://bugs.gentoo.org/952019
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2025-03-25 08:21:54 +00:00
parent 0f68eae125
commit 80d4449eb6
2 changed files with 18 additions and 8 deletions

View File

@@ -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
}

View File

@@ -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
}