From: Robert Yang <liezhi.yang@windriver.com>
To: Ming Liu <ming.liu@windriver.com>,
<openembedded-core@lists.openembedded.org>,
Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: Re: [PATCH] sstate: Fix incorrect return value handling
Date: Tue, 16 Sep 2014 17:10:20 +0800 [thread overview]
Message-ID: <5417FE7C.9070400@windriver.com> (raw)
In-Reply-To: <5417FC26.3080503@windriver.com>
On 09/16/2014 05:00 PM, Ming Liu wrote:
> On 09/12/2014 11:39 PM, Richard Purdie wrote:
>> The use of [ and && here means $? is reset and the exit 1 error
>> interception wasn't working, leading to "file changed as we read it"
>> errors from sstate_create_package when heavily using hardlinks.
>>
>> Fix this by placing $? into a variable.
>>
>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>>
>> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
>> index 0cb5235..1145a63c 100644
>> --- a/meta/classes/sstate.bbclass
>> +++ b/meta/classes/sstate.bbclass
>> @@ -599,7 +599,8 @@ sstate_create_package () {
>> if [ "$(ls -A)" ]; then
>> set +e
>> tar -czf $TFILE *
>> - if [ $? -ne 0 ] && [ $? -ne 1 ]; then
>> + ret=$?
>> + if [ $ret -ne 0 ] && [ $ret -ne 1 ]; then
> Would changing the line to "if [[ $? -ne 0 && $? -ne 1 ]] " be a better fix?
I'm afraid not, "[[" and "&&" in test are bashism.
// Robert
>
> the best,
> thank you
>> exit 1
>> fi
>> set -e
>>
>>
>
next prev parent reply other threads:[~2014-09-16 9:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-12 15:39 [PATCH] sstate: Fix incorrect return value handling Richard Purdie
2014-09-16 9:00 ` Ming Liu
2014-09-16 9:10 ` Robert Yang [this message]
2014-09-16 9:15 ` Ming Liu
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=5417FE7C.9070400@windriver.com \
--to=liezhi.yang@windriver.com \
--cc=ming.liu@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.