Gentoo Archives: gentoo-dev

From: David Michael <fedora.dm0@×××××.com>
To: gentoo-dev@l.g.o
Cc: selinux@g.o
Subject: [gentoo-dev] [PATCH 2/2] selinux-policy-2.eclass: drop EAPI 5
Date: Mon, 02 Nov 2020 21:46:31
Message-Id: 87ft5r77q3.fsf@gmail.com
1 Signed-off-by: David Michael <fedora.dm0@×××××.com>
2 ---
3
4 Grepping through the ebuilds using this eclass shows that they're all on
5 EAPI 6. A bunch of workarounds could be dropped along with EAPI 5, but
6 it isn't necessary to fix anything, so feel free to ignore this patch.
7
8 eclass/selinux-policy-2.eclass | 38 ++++++++--------------------------
9 1 file changed, 9 insertions(+), 29 deletions(-)
10
11 diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass
12 index 3ba310e49de..ce7643ecf15 100644
13 --- a/eclass/selinux-policy-2.eclass
14 +++ b/eclass/selinux-policy-2.eclass
15 @@ -7,7 +7,7 @@
16 # @ECLASS: selinux-policy-2.eclass
17 # @MAINTAINER:
18 # selinux@g.o
19 -# @SUPPORTED_EAPIS: 5 6 7
20 +# @SUPPORTED_EAPIS: 6 7
21 # @BLURB: This eclass supports the deployment of the various SELinux modules in sec-policy
22 # @DESCRIPTION:
23 # The selinux-policy-2.eclass supports deployment of the various SELinux modules
24 @@ -75,8 +75,8 @@
25 : ${SELINUX_GIT_BRANCH:="master"};
26
27 case "${EAPI:-0}" in
28 - 0|1|2|3|4) die "EAPI<5 is not supported";;
29 - 5|6|7) : ;;
30 + 0|1|2|3|4|5) die "EAPI<6 is not supported";;
31 + 6|7) : ;;
32 *) die "unknown EAPI" ;;
33 esac
34
35 @@ -87,10 +87,6 @@ case ${BASEPOL} in
36 EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy";;
37 esac
38
39 -if [[ ${EAPI:-0} == 5 ]]; then
40 - inherit eutils
41 -fi
42 -
43 IUSE=""
44
45 HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux"
46 @@ -117,7 +113,7 @@ else
47 RDEPEND=">=sys-apps/policycoreutils-2.0.82
48 >=sec-policy/selinux-base-policy-${PV}"
49 fi
50 -if [[ ${EAPI:-0} == [56] ]]; then
51 +if [[ ${EAPI:-0} == 6 ]]; then
52 DEPEND="${RDEPEND}
53 sys-devel/m4
54 >=sys-apps/checkpolicy-2.0.21"
55 @@ -162,25 +158,13 @@ selinux-policy-2_src_prepare() {
56 # Patch the sources with the base patchbundle
57 if [[ -n ${BASEPOL} ]] && [[ "${BASEPOL}" != "9999" ]]; then
58 cd "${S}"
59 - if [[ ${EAPI:-0} == 5 ]]; then
60 - EPATCH_MULTI_MSG="Applying SELinux policy updates ... " \
61 - EPATCH_SUFFIX="patch" \
62 - EPATCH_SOURCE="${WORKDIR}" \
63 - EPATCH_FORCE="yes" \
64 - epatch
65 - else
66 - einfo "Applying SELinux policy updates ... "
67 - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch"
68 - fi
69 + einfo "Applying SELinux policy updates ... "
70 + eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch"
71 fi
72
73 - # Call in epatch_user. We do this early on as we start moving
74 + # Call in eapply_user. We do this early on as we start moving
75 # files left and right hereafter.
76 - if [[ ${EAPI:-0} == 5 ]]; then
77 - epatch_user
78 - else
79 - eapply_user
80 - fi
81 + eapply_user
82
83 # Copy additional files to the 3rd_party/ location
84 if [[ "$(declare -p POLICY_FILES 2>/dev/null 2>&1)" == "declare -a"* ]] ||
85 @@ -200,11 +184,7 @@ selinux-policy-2_src_prepare() {
86 cd "${S}/refpolicy/policy/modules"
87 for POLPATCH in ${POLICY_PATCH[@]};
88 do
89 - if [[ ${EAPI:-0} == 5 ]]; then
90 - epatch "${POLPATCH}"
91 - else
92 - eapply "${POLPATCH}"
93 - fi
94 + eapply "${POLPATCH}"
95 done
96 fi
97
98 --
99 2.26.2

Replies