Skip to content

Instantly share code, notes, and snippets.

@tormath1
Created June 4, 2021 14:15
Show Gist options
  • Save tormath1/a717cf9398ab1ee429ece5398ef83187 to your computer and use it in GitHub Desktop.
Save tormath1/a717cf9398ab1ee429ece5398ef83187 to your computer and use it in GitHub Desktop.
patch to fix POLICY_PATCH applying
diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass
index 5def86fbe..8f69847a9 100644
--- a/eclass/selinux-policy-2.eclass
+++ b/eclass/selinux-policy-2.eclass
@@ -179,11 +179,12 @@ selinux-policy-2_src_prepare() {
# Apply the additional patches refered to by the module ebuild.
# But first some magic to differentiate between bash arrays and strings
- if [[ "$(declare -p POLICY_PATCH 2>/dev/null 2>&1)" == "declare -a"* ]]; then
- [[ -n ${POLICY_PATCH[*]} ]] && eapply -d "${S}/refpolicy/policy/modules" "${POLICY_PATCH[@]}"
- else
- [[ -n ${POLICY_PATCH} ]] && eapply -d "${S}/refpolicy/policy/modules" ${POLICY_PATCH}
- fi
+ cd "${S}/refpolicy/policy/modules"
+ for POLPATCH in ${POLICY_PATCH[@]};
+ do
+ einfo "Installing ${POLPATCH}"
+ eapply -p0 "${POLPATCH}"
+ done
# Collect only those files needed for this particular module
for i in ${MODS}; do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment