diff options
author | Jason Zaman <perfinion@gentoo.org> | 2017-06-18 16:58:45 +0800 |
---|---|---|
committer | Jason Zaman <perfinion@gentoo.org> | 2017-06-19 00:27:34 +0800 |
commit | 5a73a622fe4f7336a995e1659ee93dfed5835b23 (patch) | |
tree | 4cb01983fda72403f1c83a61d312195306e8abce /sec-policy | |
parent | www-misc/fcgiwrap: Add 1.1.0_pre20150419 snapshot (diff) | |
download | gentoo-5a73a622fe4f7336a995e1659ee93dfed5835b23.tar.gz gentoo-5a73a622fe4f7336a995e1659ee93dfed5835b23.tar.bz2 gentoo-5a73a622fe4f7336a995e1659ee93dfed5835b23.zip |
sec-policy/selinux-apm: remove old apm module from store
"apm" module got renamed to "acpi", must remove apm first
the contexts are okay even tho the modules are not
replaced in the same command (doesnt become unlabeled_t)
Package-Manager: Portage-2.3.5, Repoman-2.3.1
Diffstat (limited to 'sec-policy')
-rw-r--r-- | sec-policy/selinux-apm/selinux-apm-2.20170204-r4.ebuild | 23 | ||||
-rw-r--r-- | sec-policy/selinux-apm/selinux-apm-9999.ebuild | 23 |
2 files changed, 44 insertions, 2 deletions
diff --git a/sec-policy/selinux-apm/selinux-apm-2.20170204-r4.ebuild b/sec-policy/selinux-apm/selinux-apm-2.20170204-r4.ebuild index 469df11cc544..1008927338d9 100644 --- a/sec-policy/selinux-apm/selinux-apm-2.20170204-r4.ebuild +++ b/sec-policy/selinux-apm/selinux-apm-2.20170204-r4.ebuild @@ -7,8 +7,29 @@ MODS="acpi" inherit selinux-policy-2 -DESCRIPTION="SELinux policy for apm" +DESCRIPTION="SELinux policy for acpi" if [[ ${PV} != 9999* ]] ; then KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" fi + +pkg_postinst() { + # "apm" module got renamed to "acpi", must remove apm first + # the contexts are okay even tho the modules are not + # replaced in the same command (doesnt become unlabeled_t) + for i in ${POLICY_TYPES}; do + if semodule -s "${i}" -l | grep apm >/dev/null 2>&1; then + semodule -s "${i}" -r apm + fi + done + selinux-policy-2_pkg_postinst +} + +pkg_postrm() { + for i in ${POLICY_TYPES}; do + if semodule -s "${i}" -l | grep apm >/dev/null 2>&1; then + semodule -s "${i}" -r apm + fi + done + selinux-policy-2_pkg_postrm +} diff --git a/sec-policy/selinux-apm/selinux-apm-9999.ebuild b/sec-policy/selinux-apm/selinux-apm-9999.ebuild index 469df11cc544..1008927338d9 100644 --- a/sec-policy/selinux-apm/selinux-apm-9999.ebuild +++ b/sec-policy/selinux-apm/selinux-apm-9999.ebuild @@ -7,8 +7,29 @@ MODS="acpi" inherit selinux-policy-2 -DESCRIPTION="SELinux policy for apm" +DESCRIPTION="SELinux policy for acpi" if [[ ${PV} != 9999* ]] ; then KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" fi + +pkg_postinst() { + # "apm" module got renamed to "acpi", must remove apm first + # the contexts are okay even tho the modules are not + # replaced in the same command (doesnt become unlabeled_t) + for i in ${POLICY_TYPES}; do + if semodule -s "${i}" -l | grep apm >/dev/null 2>&1; then + semodule -s "${i}" -r apm + fi + done + selinux-policy-2_pkg_postinst +} + +pkg_postrm() { + for i in ${POLICY_TYPES}; do + if semodule -s "${i}" -l | grep apm >/dev/null 2>&1; then + semodule -s "${i}" -r apm + fi + done + selinux-policy-2_pkg_postrm +} |