Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.gentoo.dev > #70398
| From | Rahul Sandhu <nvraxn@posteo.uk> |
|---|---|
| Newsgroups | linux.gentoo.dev |
| Subject | [gentoo-dev] [PATCH v4 1/5] selinux-policy-2.eclass: introduce SELINUX_POLICY_USEDEP |
| Date | 2026-04-07 17:30 +0200 |
| Message-ID | <MHgxj-dnPm-3@gated-at.bofh.it> (permalink) |
| References | <MHgnD-dnM7-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Policy packages need to apply the same, consistent set of constraints
for the various policy types onto any dependencies. As such, introduce
SELINUX_POLICY_USEDEP for consumers to easily append such constraints:
> sec-policy/selinux-foo[${SELINUX_USEDEP}]
Signed-off-by: Rahul Sandhu <nvraxn@posteo.uk>
---
eclass/selinux-policy-2.eclass | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass
index 96bf57746f68..fff8adea6ae9 100644
--- a/eclass/selinux-policy-2.eclass
+++ b/eclass/selinux-policy-2.eclass
@@ -84,6 +84,12 @@ fi
# The default value is the 'master' branch.
: "${SELINUX_GIT_BRANCH:="master"}"
+# @ECLASS_VARIABLE: SELINUX_POLICY_USEDEP
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# This variable contains the USE dependency constraints for policy packages.
+SELINUX_POLICY_USEDEP="selinux_policy_types_targeted(-)?,selinux_policy_types_strict(-)?,selinux_policy_types_mcs(-)?,selinux_policy_types_mls(-)?"
+
case ${BASEPOL} in
9999)
inherit git-r3
@@ -127,15 +133,10 @@ if [[ ${EAPI} = 7 ]]; then
>=sec-policy/selinux-base-policy-${_BASE_POLICY_VERSION}
"
else
- RDEPEND=">=sys-apps/policycoreutils-2.5"
- for _poltype in selinux_policy_types_{targeted,strict,mcs,mls}; do
- RDEPEND+="
- ${_poltype}? (
- >=sec-policy/selinux-base-policy-${_BASE_POLICY_VERSION}[${_poltype}]
- )
- "
- done
- unset _poltype
+ RDEPEND="
+ >=sys-apps/policycoreutils-2.5
+ >=sec-policy/selinux-base-policy-${_BASE_POLICY_VERSION}[${SELINUX_POLICY_USEDEP}]
+ "
fi
unset _BASE_POLICY_VERSION
--
2.53.0
Back to linux.gentoo.dev | Previous | Next | Find similar
[gentoo-dev] [PATCH v4 1/5] selinux-policy-2.eclass: introduce SELINUX_POLICY_USEDEP Rahul Sandhu <nvraxn@posteo.uk> - 2026-04-07 17:30 +0200
csiph-web