Gentoo Archives: gentoo-commits

From: Sven Vermeulen <sven.vermeulen@××××××.be>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:master commit in: eclass/
Date: Tue, 01 May 2012 11:26:59
Message-Id: 1335871580.36526e28cee3266ed5e62b56933fbc41e1ef3410.SwifT@gentoo
1 commit: 36526e28cee3266ed5e62b56933fbc41e1ef3410
2 Author: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
3 AuthorDate: Tue May 1 11:26:20 2012 +0000
4 Commit: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
5 CommitDate: Tue May 1 11:26:20 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=36526e28
7
8 Simplify eclass further, drop use of trigger file
9
10 ---
11 eclass/selinux-policy-2.eclass | 37 +++++++++----------------------------
12 1 files changed, 9 insertions(+), 28 deletions(-)
13
14 diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass
15 index c6f993a..07ee6c2 100644
16 --- a/eclass/selinux-policy-2.eclass
17 +++ b/eclass/selinux-policy-2.eclass
18 @@ -138,44 +138,27 @@ selinux-policy-2_src_prepare() {
19 fi
20
21 # Copy additional files to the 3rd_party/ location
22 - if [[ "$(declare -p POLICY_FILES 2>/dev/null 2>&1)" == "declare -a"* ]];
23 + if [[ "$(declare -p POLICY_FILES 2>/dev/null 2>&1)" == "declare -a"* ]] ||
24 + [[ -n ${POLICY_FILES} ]];
25 then
26 - add_interfaces=1;
27 + add_interfaces=1;
28 cd "${S}/refpolicy/policy/modules"
29 - for POLFILE in "${POLICY_FILES[@]}";
30 + for POLFILE in ${POLICY_FILES[@]};
31 do
32 - cp "${FILESDIR}/${POLFILE}" 3rd_party/ || die "Could not copy over ${POLFILE} to 3rd_party/ location";
33 + cp "${FILESDIR}/${POLFILE}" 3rd_party/ || die "Could not copy ${POLFILE} to 3rd_party/ location";
34 done
35 - else
36 - if [[ -n ${POLICY_FILES} ]];
37 - then
38 - add_interfaces=1;
39 - cd "${S}/refpolicy/policy/modules"
40 - for POLFILE in ${POLICY_FILES};
41 - do
42 - cp "${FILESDIR}/${POLFILE}" 3rd_party/ || die "Could not copy ${POLFILE} into 3rd_party/ location";
43 - done
44 - fi
45 fi
46
47 # Apply the additional patches refered to by the module ebuild.
48 # But first some magic to differentiate between bash arrays and strings
49 - if [[ "$(declare -p POLICY_PATCH 2>/dev/null 2>&1)" == "declare -a"* ]];
50 + if [[ "$(declare -p POLICY_PATCH 2>/dev/null 2>&1)" == "declare -a"* ]] ||
51 + [[ -n ${POLICY_PATCH} ]];
52 then
53 cd "${S}/refpolicy/policy/modules"
54 - for POLPATCH in "${POLICY_PATCH[@]}";
55 + for POLPATCH in ${POLICY_PATCH[@]};
56 do
57 epatch "${POLPATCH}"
58 done
59 - else
60 - if [[ -n ${POLICY_PATCH} ]];
61 - then
62 - cd "${S}/refpolicy/policy/modules"
63 - for POLPATCH in ${POLICY_PATCH};
64 - do
65 - epatch "${POLPATCH}"
66 - done
67 - fi
68 fi
69
70 # Collect only those files needed for this particular module
71 @@ -195,8 +178,6 @@ selinux-policy-2_src_prepare() {
72
73 cp ${modfiles} "${S}"/${i} \
74 || die "Failed to copy the module files to ${S}/${i}"
75 -
76 - [ ${add_interfaces} -eq 1 ] && touch "${S}"/${i}/.install_interfaces;
77 done
78 }
79
80 @@ -224,7 +205,7 @@ selinux-policy-2_src_install() {
81 insinto ${BASEDIR}/${i}
82 doins "${S}"/${i}/${j}.pp || die "Failed to add ${j}.pp to ${i}"
83
84 - if [[ -f "${S}/${i}/.install_interfaces" ]];
85 + if [[ "${POLICY_FILES[@]}" == *"${j}.if"* ]];
86 then
87 insinto ${BASEDIR}/${i}/include/3rd_party
88 doins "${S}"/${i}/${j}.if || die "Failed to add ${j}.if to ${i}"