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 1QogvY-0003xC-81 for garchives@archives.gentoo.org; Wed, 03 Aug 2011 19:16:24 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3580221C272; Wed, 3 Aug 2011 19:16:11 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 089D221C272 for ; Wed, 3 Aug 2011 19:16:10 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7A4A81B4035 for ; Wed, 3 Aug 2011 19:16:10 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id CB90380042 for ; Wed, 3 Aug 2011 19:16:09 +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: 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: a5a72f5b16fc711977cd8798cb6bcb16769d7e8f Date: Wed, 3 Aug 2011 19:16:09 +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: X-Archives-Hash: 72c859fb6c386a6fc92741397abcd91e commit: a5a72f5b16fc711977cd8798cb6bcb16769d7e8f Author: Sven Vermeulen siphos be> AuthorDate: Wed Aug 3 19:15:36 2011 +0000 Commit: Sven Vermeulen siphos be> CommitDate: Wed Aug 3 19:15:36 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/hardened-dev.= git;a=3Dcommit;h=3Da5a72f5b Support bash arrays for POLICY_PATCH. Thanks to Peter Volkov (pva g.= o) --- eclass/selinux-policy-2.eclass | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.ecl= ass index 400abb7..3b75c1f 100644 --- a/eclass/selinux-policy-2.eclass +++ b/eclass/selinux-policy-2.eclass @@ -34,7 +34,8 @@ # @ECLASS-VARIABLE: POLICY_PATCH # @DESCRIPTION: # This variable contains the additional patch(es) that need to be applie= d on top -# of the patchset already contained within the BASEPOL variable.=20 +# of the patchset already contained within the BASEPOL variable. The var= iable +# can be both a simple string (space-separated) or a bash array. : ${POLICY_PATCH:=3D""} =20 # @ECLASS-VARIABLE: POLICY_TYPES @@ -119,14 +120,24 @@ selinux-policy-2_src_prepare() { epatch "${PATCHBUNDLE}" fi =20 - # Apply the additional patches refered to by the module ebuild - if [[ -n ${POLICY_PATCH} ]]; + # 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"= * ]]; then - for POLPATCH in ${POLICY_PATCH}; + cd "${S}/refpolicy/policy/modules" + for POLPATCH in "${POLICY_PATCH[@]}"; do - cd "${S}/refpolicy/policy/modules" 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