Gentoo Archives: gentoo-commits

From: "Anthony G. Basile (blueness)" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: selinux-policy-2.eclass
Date: Sat, 05 Feb 2011 11:28:19
Message-Id: 20110205112810.83F9020054@flycatcher.gentoo.org
1 blueness 11/02/05 11:28:10
2
3 Modified: selinux-policy-2.eclass
4 Log:
5 Fixed policy patching.
6
7 Revision Changes Path
8 1.5 eclass/selinux-policy-2.eclass
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/selinux-policy-2.eclass?rev=1.5&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/selinux-policy-2.eclass?rev=1.5&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/selinux-policy-2.eclass?r1=1.4&r2=1.5
13
14 Index: selinux-policy-2.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/selinux-policy-2.eclass,v
17 retrieving revision 1.4
18 retrieving revision 1.5
19 diff -u -r1.4 -r1.5
20 --- selinux-policy-2.eclass 2 Aug 2009 02:58:25 -0000 1.4
21 +++ selinux-policy-2.eclass 5 Feb 2011 11:28:10 -0000 1.5
22 @@ -1,9 +1,9 @@
23 # Copyright 1999-2006 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/selinux-policy-2.eclass,v 1.4 2009/08/02 02:58:25 pebenito Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/selinux-policy-2.eclass,v 1.5 2011/02/05 11:28:10 blueness Exp $
27
28 # Eclass for installing SELinux policy, and optionally
29 -# reloading the reference-policy based modules
30 +# reloading the reference-policy based modules.
31
32 inherit eutils
33
34 @@ -32,7 +32,6 @@
35 for i in ${MODS}; do
36 modfiles="`find ${S}/refpolicy/policy/modules -iname $i.te` $modfiles"
37 modfiles="`find ${S}/refpolicy/policy/modules -iname $i.fc` $modfiles"
38 - # use .if from headers
39 done
40
41 for i in ${POLICY_TYPES}; do
42 @@ -42,8 +41,12 @@
43 cp ${modfiles} "${S}"/${i}
44
45 if [ -n "${POLICY_PATCH}" ]; then
46 - cd "${S}"/${i}
47 - epatch "${POLICY_PATCH}" || die "failed patch ${i}"
48 + for POLPATCH in "${POLICY_PATCH}";
49 + do
50 + cd "${S}"/${i}
51 + einfo "Patching ${i}"
52 + epatch "${POLPATCH}" || die "failed patch ${POLPATCH}"
53 + done
54 fi
55
56 done
57 @@ -78,26 +81,12 @@
58 done
59 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
60
61 - if has "loadpolicy" $FEATURES ; then
62 - for i in ${POLICY_TYPES}; do
63 - einfo "Inserting the following modules into the $i module store: ${MODS}"
64 + for i in ${POLICY_TYPES}; do
65 + einfo "Inserting the following modules into the $i module store: ${MODS}"
66
67 - cd /usr/share/selinux/${i}
68 - semodule -s ${i} ${COMMAND}
69 - done
70 - else
71 - echo
72 - echo
73 - eerror "Policy has not been loaded. It is strongly suggested"
74 - eerror "that the policy be loaded before continuing!!"
75 - echo
76 - einfo "Automatic policy loading can be enabled by adding"
77 - einfo "\"loadpolicy\" to the FEATURES in make.conf."
78 - echo
79 - echo
80 - ebeep 4
81 - epause 4
82 - fi
83 + cd /usr/share/selinux/${i}
84 + semodule -s ${i} ${COMMAND}
85 + done
86 }
87
88 EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst