sstate: Fix incorrect return value handling

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.

(From OE-Core rev: 6e51f900b76b06c09a3d6927f8db7398e2c035ed)

(From OE-Core rev: 75040a098e11927e6872e3a2a6286fe3ed0c7f47)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2014-09-12 16:39:16 +01:00
parent 70290325e4
commit 57edf5991a
1 changed files with 2 additions and 1 deletions

View File

@ -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
exit 1
fi
set -e