[OE-core] [PATCH v2] sstate.bbclass: update .siginfo atime

Ed Bartosh ed.bartosh at linux.intel.com
Mon Mar 6 19:58:18 UTC 2017


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 at 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



More information about the Openembedded-core mailing list