public inbox for gentoo-hardened@lists.gentoo.org
 help / color / mirror / Atom feed
From: Peter Volkov <pva@gentoo.org>
To: gentoo-hardened@lists.gentoo.org
Subject: Re: [gentoo-hardened] Update on selinux-policy-2 eclass
Date: Wed, 03 Aug 2011 19:01:11 +0400	[thread overview]
Message-ID: <1312383671.25999.12.camel@tablet> (raw)
In-Reply-To: <20110803132932.GA9734@siphos.be>

В Срд, 03/08/2011 в 15:29 +0200, Sven Vermeulen пишет:
> > 4. [ -n "${POLICY_PATCH}" ]
> > generally it's better to use bash tests [[ ]] and avoid quotation.
> 
> For POLICY_PATCH, I'll keep the quotation(s) because it can contain multiple
> patches (space-separated).

If you use [[ -n ${POLICY_PATCH} ]] then quotation is not needed even in
case it contains multiple values. E.g. here:
if [[ -n "${POLICY_PATCH}" ]];

quotation is not required - bash will understand this correctly.

BTW,
		for POLPATCH in "${POLICY_PATCH}";
		do
			cd "${S}/refpolicy/policy/modules"
			epatch "${POLPATCH}"
		done

It looks like quotation is not necessary around "${POLICY_PATCH}"?
Independently of how many values has "${POLICY_PATCH}" values for cycle
will iterate only once.

Also it looks like it's better use bash array for POLICY_PATCH. This way
you'll allow path to patch to have spaces and still correct iteration.
For example take a look at PATCHES variable in base.eclass. It has code
that allows you to make such changes in eclass backward compatible. But
still it's better to use arrays so probably it's good idea for eclass
just die in case user uses POLICY_PATCH as a variable and not as a bash
array:

POLICY_PATCH=( "${FILESDIR}/mypatch.patch" "${FILESDIR}/patches_folder/"
)

[[ "$(declare -p POLICY_PATCH 2>/dev/null 2>&1)" == "declare -a"* ]] ||
die
for x in "${POLICY_PATCH[@]}"; do
            epatch "${x}"
done

> > 8. 
> > selinux-policy-2_src_compile() {
> > 	for i in ${POLICY_TYPES}; do
> > 		make NAME=$i -C "${S}"/${i} || die "${i} compile failed"
> > Is parallel build unsupported here? May be emake?
> 
> emake fails here

It's good idea to document this within comments above and use emake -j1.

--
Peter.





      reply	other threads:[~2011-08-03 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02  7:19 [gentoo-hardened] Update on selinux-policy-2 eclass Sven Vermeulen
2011-08-03 10:59 ` Peter Volkov
2011-08-03 13:29   ` Sven Vermeulen
2011-08-03 15:01     ` Peter Volkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312383671.25999.12.camel@tablet \
    --to=pva@gentoo.org \
    --cc=gentoo-hardened@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox