Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sec-policy/selinux-apm/
Date: Sun, 18 Jun 2017 16:27:49
Message-Id: 1497803254.5a73a622fe4f7336a995e1659ee93dfed5835b23.perfinion@gentoo
1 commit: 5a73a622fe4f7336a995e1659ee93dfed5835b23
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 18 08:58:45 2017 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 18 16:27:34 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a73a622
7
8 sec-policy/selinux-apm: remove old apm module from store
9
10 "apm" module got renamed to "acpi", must remove apm first
11 the contexts are okay even tho the modules are not
12 replaced in the same command (doesnt become unlabeled_t)
13
14 Package-Manager: Portage-2.3.5, Repoman-2.3.1
15
16 .../selinux-apm/selinux-apm-2.20170204-r4.ebuild | 23 +++++++++++++++++++++-
17 sec-policy/selinux-apm/selinux-apm-9999.ebuild | 23 +++++++++++++++++++++-
18 2 files changed, 44 insertions(+), 2 deletions(-)
19
20 diff --git a/sec-policy/selinux-apm/selinux-apm-2.20170204-r4.ebuild b/sec-policy/selinux-apm/selinux-apm-2.20170204-r4.ebuild
21 index 469df11cc54..1008927338d 100644
22 --- a/sec-policy/selinux-apm/selinux-apm-2.20170204-r4.ebuild
23 +++ b/sec-policy/selinux-apm/selinux-apm-2.20170204-r4.ebuild
24 @@ -7,8 +7,29 @@ MODS="acpi"
25
26 inherit selinux-policy-2
27
28 -DESCRIPTION="SELinux policy for apm"
29 +DESCRIPTION="SELinux policy for acpi"
30
31 if [[ ${PV} != 9999* ]] ; then
32 KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
33 fi
34 +
35 +pkg_postinst() {
36 + # "apm" module got renamed to "acpi", must remove apm first
37 + # the contexts are okay even tho the modules are not
38 + # replaced in the same command (doesnt become unlabeled_t)
39 + for i in ${POLICY_TYPES}; do
40 + if semodule -s "${i}" -l | grep apm >/dev/null 2>&1; then
41 + semodule -s "${i}" -r apm
42 + fi
43 + done
44 + selinux-policy-2_pkg_postinst
45 +}
46 +
47 +pkg_postrm() {
48 + for i in ${POLICY_TYPES}; do
49 + if semodule -s "${i}" -l | grep apm >/dev/null 2>&1; then
50 + semodule -s "${i}" -r apm
51 + fi
52 + done
53 + selinux-policy-2_pkg_postrm
54 +}
55
56 diff --git a/sec-policy/selinux-apm/selinux-apm-9999.ebuild b/sec-policy/selinux-apm/selinux-apm-9999.ebuild
57 index 469df11cc54..1008927338d 100644
58 --- a/sec-policy/selinux-apm/selinux-apm-9999.ebuild
59 +++ b/sec-policy/selinux-apm/selinux-apm-9999.ebuild
60 @@ -7,8 +7,29 @@ MODS="acpi"
61
62 inherit selinux-policy-2
63
64 -DESCRIPTION="SELinux policy for apm"
65 +DESCRIPTION="SELinux policy for acpi"
66
67 if [[ ${PV} != 9999* ]] ; then
68 KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
69 fi
70 +
71 +pkg_postinst() {
72 + # "apm" module got renamed to "acpi", must remove apm first
73 + # the contexts are okay even tho the modules are not
74 + # replaced in the same command (doesnt become unlabeled_t)
75 + for i in ${POLICY_TYPES}; do
76 + if semodule -s "${i}" -l | grep apm >/dev/null 2>&1; then
77 + semodule -s "${i}" -r apm
78 + fi
79 + done
80 + selinux-policy-2_pkg_postinst
81 +}
82 +
83 +pkg_postrm() {
84 + for i in ${POLICY_TYPES}; do
85 + if semodule -s "${i}" -l | grep apm >/dev/null 2>&1; then
86 + semodule -s "${i}" -r apm
87 + fi
88 + done
89 + selinux-policy-2_pkg_postrm
90 +}