From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>,
Martin Kelly <mkelly@xevo.com>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v3 2/6] toolchain-scripts: allow non-sh post-relocate
Date: Tue, 05 Jun 2018 11:36:05 +0100 [thread overview]
Message-ID: <355d4f0ef965769e2baf353abaf35ab730fc6863.camel@linuxfoundation.org> (raw)
In-Reply-To: <e9d0cb69fa974fc38eaa460a1d06d88a@XBOX02.axis.com>
On Tue, 2018-06-05 at 10:27 +0000, Peter Kjellerstedt wrote:
> > -----Original Message-----
> > From: openembedded-core-bounces@lists.openembedded.org
> > [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf
> > Of
> > Martin Kelly
> > Sent: den 5 juni 2018 01:06
> > To: openembedded-core@lists.openembedded.org
> > Subject: [OE-core] [PATCH v3 2/6] toolchain-scripts: allow non-sh
> > post-
> > relocate
> >
> > Currently, we look only for scripts matching *.sh, which means we
> > can't
> > write post-relocate scripts in other languages.
> >
> > Expand this to allow any type of script.
> >
> > Signed-off-by: Martin Kelly <mkelly@xevo.com>
> > ---
> > v3:
> > - Test for executability prior to running each script.
> >
> > meta/classes/toolchain-scripts.bbclass | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/toolchain-scripts.bbclass
> > b/meta/classes/toolchain-scripts.bbclass
> > index a72436167c..da8a57f24b 100644
> > --- a/meta/classes/toolchain-scripts.bbclass
> > +++ b/meta/classes/toolchain-scripts.bbclass
> > @@ -124,7 +124,10 @@ toolchain_create_post_relocate_script() {
> >
> > cat >> $script <<EOF
> > if [ -d "${SDKPATHNATIVE}/post-relocate-setup.d/" ]; then
> > - for s in ${SDKPATHNATIVE}/post-relocate-setup.d/*.sh; do
> > + for s in ${SDKPATHNATIVE}/post-relocate-setup.d/*; do
> > + if [ ! -x \$s ]; then
> > + continue
> > + fi
>
> That can be written as:
>
> [ -x \$s ] || continue
>
> > \$s "\$1"
>
> Or you can replace all of it with:
>
> [ ! -x \$s ] || \$s "\$1"
>
> You should not invert the test and replace the || with && though
> (even if it may seem more logical) due to the return status of
> the [ command in case $s is not executable.
FWIW personally I prefer the original patch version as being more
readable...
Cheers,
Richard
next prev parent reply other threads:[~2018-06-05 10:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-04 23:05 [PATCH v3 0/6] meson: implement nativesdk support Martin Kelly
2018-06-04 23:05 ` [PATCH v3 1/6] toolchain-scripts: retab file Martin Kelly
2018-06-05 10:09 ` Peter Kjellerstedt
2018-06-05 10:36 ` Richard Purdie
2018-06-05 12:04 ` Peter Kjellerstedt
2018-06-05 16:56 ` Martin Kelly
2018-06-04 23:05 ` [PATCH v3 2/6] toolchain-scripts: allow non-sh post-relocate Martin Kelly
2018-06-05 10:27 ` Peter Kjellerstedt
2018-06-05 10:36 ` Richard Purdie [this message]
2018-06-04 23:05 ` [PATCH v3 3/6] toolchain-scripts: print post-relocate error Martin Kelly
2018-06-04 23:06 ` [PATCH v3 4/6] toolchain-scripts: pass env to post-relocate Martin Kelly
2018-06-04 23:06 ` [PATCH v3 5/6] meson: handle exe wrappers Martin Kelly
2018-06-04 23:06 ` [PATCH v3 6/6] meson: enable nativesdk Martin Kelly
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=355d4f0ef965769e2baf353abaf35ab730fc6863.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=mkelly@xevo.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=peter.kjellerstedt@axis.com \
/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