]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate: Fix incorrect return value handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 12 Sep 2014 15:39:16 +0000 (16:39 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 16 Sep 2014 21:12:29 +0000 (22:12 +0100)
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)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sstate.bbclass

index 67e0c1d13a24735cde6e5501de4f97ba5b4d11fe..2d8db57c812033e35c6b43d2e9355ec49112e6b2 100644 (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