Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: Patrick Ohly <patrick.ohly@intel.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v2] sstate.bbclass: update .siginfo atime
Date: Mon, 6 Mar 2017 21:58:18 +0200	[thread overview]
Message-ID: <20170306195818.GB19275@linux.intel.com> (raw)
In-Reply-To: <1488828715.7785.310.camel@intel.com>

On Mon, Mar 06, 2017 at 08:31:55PM +0100, Patrick Ohly wrote:
> On Mon, 2017-03-06 at 19:50 +0200, Ed Bartosh wrote:
> > On Mon, Mar 06, 2017 at 04:49:25PM +0000, Burton, Ross wrote:
> > > On 6 March 2017 at 15:31, Ed Bartosh <ed.bartosh@linux.intel.com> wrote:
> > > 
> > > > +       [ -h ${SSTATE_PKG}.siginfo ] && touch -a ${SSTATE_PKG}.siginfo
> > > >
> > > 
> > > $ ( [ -h / ] && echo something ); echo $?
> > > 1
> > > 
> > > If the -h fails then this is still going to cause sstate_unpack_package to
> > > trap.
> > 
> > I don't think it will as '&&' and '||' lists are among other special cases where
> > shell doesn't exits on error.
> 
> True, but if the clause happens to be the last one in a function or
> script (for example, after restructuring code), then the return code of
> that becomes non-zero, which isn't intended.

Exactly because of this I moved my changes up in the function in v2.

> 
> $ cat test.sh 
> foo() {
>     [ -h /foobar ] && echo 'fstab is a symlink'
> }
> 
> foo
> echo $?
> $ bash -xe test.sh 
> + set -e
> + foo
> + '[' -h /foobar ']'
> $ echo $?
> 1
> 
> Making the intend explicit with || true avoids that.
> 
> -- 
> Best Regards, Patrick Ohly
> 
> The content of this message is my personal opinion only and although
> I am an employee of Intel, the statements I make here in no way
> represent Intel's position on the issue, nor am I authorized to speak
> on behalf of Intel on this matter.
> 
> 
> 

-- 
--
Regards,
Ed


  reply	other threads:[~2017-03-06 20:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01 14:28 [PATCH] sstate.bbclass: update .siginfo atime Ed Bartosh
2017-03-04 10:38 ` Richard Purdie
2017-03-06 11:14 ` Burton, Ross
2017-03-06 12:37   ` Ed Bartosh
2017-03-06 15:31   ` [PATCH v2] " Ed Bartosh
2017-03-06 16:49     ` Burton, Ross
2017-03-06 17:50       ` Ed Bartosh
2017-03-06 19:31         ` Patrick Ohly
2017-03-06 19:58           ` Ed Bartosh [this message]
2017-03-06 21:46             ` Patrick Ohly
2017-03-07 11:29               ` Peter Kjellerstedt
2017-03-06 20:49         ` Burton, Ross

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=20170306195818.GB19275@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=patrick.ohly@intel.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