Gentoo Archives: gentoo-commits

From: Kenton Groombridge <concord@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 30 Jun 2022 17:04:21
Message-Id: 1656608604.a0be96d697774e1d79685290f3a0547dba118673.concord@gentoo
1 commit: a0be96d697774e1d79685290f3a0547dba118673
2 Author: Krzesimir Nowak <knowak <AT> microsoft <DOT> com>
3 AuthorDate: Wed Jun 29 15:05:23 2022 +0000
4 Commit: Kenton Groombridge <concord <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 30 17:03:24 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0be96d6
7
8 eclass/selinux-policy-2: fix POLICY_PATCH applying
9
10 eapply as implemented in portage has some heuristics to find out where
11 the parameters that should be passed to patch utility end and actual
12 diff/patch files begin. It first tries to find -- which is the
13 explicit way of separating parameters from input files. Since there's
14 none, it tries to find a first non-option. And it finds the refpolicy
15 directory as a first non-option, while it is supposed to be a value of
16 the -d parameter. The said directory is then treated as an input
17 directory, which is expected to contain at least one patch or diff
18 file. Since there's none, eapply fails.
19
20 Help eapply's heuristics by explicitly delimiting the parameters from
21 input files with --.
22
23 Bug: https://bugs.gentoo.org/794682
24 Signed-off-by: Krzesimir Nowak <knowak <AT> microsoft.com>
25 Closes: https://github.com/gentoo/gentoo/pull/26148
26 Signed-off-by: Kenton Groombridge <concord <AT> gentoo.org>
27
28 eclass/selinux-policy-2.eclass | 6 +++---
29 1 file changed, 3 insertions(+), 3 deletions(-)
30
31 diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass
32 index 81d982f749c1..b2d53a2aac0b 100644
33 --- a/eclass/selinux-policy-2.eclass
34 +++ b/eclass/selinux-policy-2.eclass
35 @@ -159,7 +159,7 @@ selinux-policy-2_src_prepare() {
36 if [[ -n ${BASEPOL} ]] && [[ "${BASEPOL}" != "9999" ]]; then
37 cd "${S}"
38 einfo "Applying SELinux policy updates ... "
39 - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch"
40 + eapply -p0 -- "${WORKDIR}/0001-full-patch-against-stable-release.patch"
41 fi
42
43 # Call in eapply_user. We do this early on as we start moving
44 @@ -180,9 +180,9 @@ selinux-policy-2_src_prepare() {
45 # Apply the additional patches refered to by the module ebuild.
46 # But first some magic to differentiate between bash arrays and strings
47 if [[ "$(declare -p POLICY_PATCH 2>/dev/null 2>&1)" == "declare -a"* ]]; then
48 - [[ -n ${POLICY_PATCH[*]} ]] && eapply -d "${S}/refpolicy/policy/modules" "${POLICY_PATCH[@]}"
49 + [[ -n ${POLICY_PATCH[*]} ]] && eapply -d "${S}/refpolicy/policy/modules" -- "${POLICY_PATCH[@]}"
50 else
51 - [[ -n ${POLICY_PATCH} ]] && eapply -d "${S}/refpolicy/policy/modules" ${POLICY_PATCH}
52 + [[ -n ${POLICY_PATCH} ]] && eapply -d "${S}/refpolicy/policy/modules" -- ${POLICY_PATCH}
53 fi
54
55 # Collect only those files needed for this particular module