From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SPBER-0004Op-Bb for garchives@archives.gentoo.org; Tue, 01 May 2012 11:26:59 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D5CE3E0771; Tue, 1 May 2012 11:26:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 90BE9E0771 for ; Tue, 1 May 2012 11:26:51 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E60241B401F for ; Tue, 1 May 2012 11:26:50 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id B0312E5403 for ; Tue, 1 May 2012 11:26:49 +0000 (UTC) From: "Sven Vermeulen" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Vermeulen" Message-ID: <1335871580.36526e28cee3266ed5e62b56933fbc41e1ef3410.SwifT@gentoo> Subject: [gentoo-commits] proj/hardened-dev:master commit in: eclass/ X-VCS-Repository: proj/hardened-dev X-VCS-Files: eclass/selinux-policy-2.eclass X-VCS-Directories: eclass/ X-VCS-Committer: SwifT X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: 36526e28cee3266ed5e62b56933fbc41e1ef3410 X-VCS-Branch: master Date: Tue, 1 May 2012 11:26:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: b77061b0-1d17-4cd4-88e7-ba5b3a7335fe X-Archives-Hash: 2b130982dcd6334b1207b3c84c3ab0b4 commit: 36526e28cee3266ed5e62b56933fbc41e1ef3410 Author: Sven Vermeulen siphos be> AuthorDate: Tue May 1 11:26:20 2012 +0000 Commit: Sven Vermeulen siphos be> CommitDate: Tue May 1 11:26:20 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/hardened-dev.= git;a=3Dcommit;h=3D36526e28 Simplify eclass further, drop use of trigger file --- eclass/selinux-policy-2.eclass | 37 +++++++++-------------------------= --- 1 files changed, 9 insertions(+), 28 deletions(-) diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.ecl= ass index c6f993a..07ee6c2 100644 --- a/eclass/selinux-policy-2.eclass +++ b/eclass/selinux-policy-2.eclass @@ -138,44 +138,27 @@ selinux-policy-2_src_prepare() { fi =20 # Copy additional files to the 3rd_party/ location - if [[ "$(declare -p POLICY_FILES 2>/dev/null 2>&1)" =3D=3D "declare -a"= * ]]; + if [[ "$(declare -p POLICY_FILES 2>/dev/null 2>&1)" =3D=3D "declare -a"= * ]] || + [[ -n ${POLICY_FILES} ]]; then - add_interfaces=3D1; + add_interfaces=3D1; cd "${S}/refpolicy/policy/modules" - for POLFILE in "${POLICY_FILES[@]}"; + for POLFILE in ${POLICY_FILES[@]}; do - cp "${FILESDIR}/${POLFILE}" 3rd_party/ || die "Could not copy over ${= POLFILE} to 3rd_party/ location"; + cp "${FILESDIR}/${POLFILE}" 3rd_party/ || die "Could not copy ${POLFI= LE} to 3rd_party/ location"; done - else - if [[ -n ${POLICY_FILES} ]]; - then - add_interfaces=3D1; - cd "${S}/refpolicy/policy/modules" - for POLFILE in ${POLICY_FILES}; - do - cp "${FILESDIR}/${POLFILE}" 3rd_party/ || die "Could not copy ${POLF= ILE} into 3rd_party/ location"; - done - fi fi =20 # Apply the additional patches refered to by the module ebuild. # But first some magic to differentiate between bash arrays and strings - if [[ "$(declare -p POLICY_PATCH 2>/dev/null 2>&1)" =3D=3D "declare -a"= * ]]; + if [[ "$(declare -p POLICY_PATCH 2>/dev/null 2>&1)" =3D=3D "declare -a"= * ]] || + [[ -n ${POLICY_PATCH} ]]; then cd "${S}/refpolicy/policy/modules" - for POLPATCH in "${POLICY_PATCH[@]}"; + for POLPATCH in ${POLICY_PATCH[@]}; do epatch "${POLPATCH}" done - else - if [[ -n ${POLICY_PATCH} ]]; - then - cd "${S}/refpolicy/policy/modules" - for POLPATCH in ${POLICY_PATCH}; - do - epatch "${POLPATCH}" - done - fi fi =20 # Collect only those files needed for this particular module @@ -195,8 +178,6 @@ selinux-policy-2_src_prepare() { =20 cp ${modfiles} "${S}"/${i} \ || die "Failed to copy the module files to ${S}/${i}" - - [ ${add_interfaces} -eq 1 ] && touch "${S}"/${i}/.install_interfaces; done } =20 @@ -224,7 +205,7 @@ selinux-policy-2_src_install() { insinto ${BASEDIR}/${i} doins "${S}"/${i}/${j}.pp || die "Failed to add ${j}.pp to ${i}" =20 - if [[ -f "${S}/${i}/.install_interfaces" ]]; + if [[ "${POLICY_FILES[@]}" =3D=3D *"${j}.if"* ]]; then insinto ${BASEDIR}/${i}/include/3rd_party doins "${S}"/${i}/${j}.if || die "Failed to add ${j}.if to ${i}"