summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2013-09-22 08:25:55 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-24 17:24:12 +0100
commit8c5f3454971074d3f1de7bcde9481e881221e076 (patch)
tree071c5229f08fe2f8808c925b64c1f82a07b0e60b
parent0fc8317c6385eb1ed69ca4522ee6424c456dbb92 (diff)
downloadpoky-8c5f3454971074d3f1de7bcde9481e881221e076.tar.gz
sstate.bbclass: ignore the tar failure.
sstate_package creates hardlink from sysroot to SSTATE_BUILDDIR, and sstate_create_package stores SSTATE_BUILDDIR into a archive file by tar, these two task can be run simultaneously for different packages, and make a hardlink for a file will lead to the change of the links number of file, and if tar is reading this file, it will fail with exit code 1, and report "file changed as we read it": DEBUG: Executing shell function sstate_create_package tar: x86_64-linux/usr/share/aclocal/xorg-macros.m4: file changed as we read it 4b3e353a5[sstate.bbclass: fix parallel building issue] tries to use the tar parameter --ignore-failed-read to fix, but it does not work, and tar parameter --warning=no-file-changed can close the warning, but can not change the exit code. so close shell immediate exit, only fail if tar returns not 1 and 0. Exit codes of tar: http://www.gnu.org/software/tar/manual/html_section/Synopsis.html (From OE-Core rev: fad604b719e00b03e09da5fdb485e72332275b4a) Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sstate.bbclass7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 37ade3f7a6..517c1001d2 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -566,7 +566,12 @@ sstate_create_package () {
566 TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX` 566 TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX`
567 # Need to handle empty directories 567 # Need to handle empty directories
568 if [ "$(ls -A)" ]; then 568 if [ "$(ls -A)" ]; then
569 tar --ignore-failed-read -czf $TFILE * 569 set +e
570 tar -czf $TFILE *
571 if [ $? -ne 0 ] && [ $? -ne 1 ]; then
572 exit 1
573 fi
574 set -e
570 else 575 else
571 tar -cz --file=$TFILE --files-from=/dev/null 576 tar -cz --file=$TFILE --files-from=/dev/null
572 fi 577 fi