summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-14 17:23:10 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-15 09:33:53 +0100
commit055402e5504f041c346571e243c7cf0894955cad (patch)
tree1969e07c35889a757815d60e5a481c5effeef747
parentacec5180b8d2731002979179e08439b615631e70 (diff)
downloadopenembedded-core-contrib-055402e5504f041c346571e243c7cf0894955cad.tar.gz
openembedded-core-contrib-055402e5504f041c346571e243c7cf0894955cad.tar.bz2
openembedded-core-contrib-055402e5504f041c346571e243c7cf0894955cad.zip
sstate/lib.oe.path: Ensure file sparseness is preserved
Files when restored from sstate were missing their sparseness. Fix up various functions to preserve this and make things more deterministic. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sstate.bbclass4
-rw-r--r--meta/lib/oe/path.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index cd42db665c..402b9e9c5c 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -721,9 +721,9 @@ sstate_create_package () {
TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX`
# Use pigz if available
- OPT="-cz"
+ OPT="-czS"
if [ -x "$(command -v pigz)" ]; then
- OPT="-I pigz -c"
+ OPT="-I pigz -cS"
fi
# Need to handle empty directories
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index be02218c31..1e24d0586b 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -86,7 +86,7 @@ def copytree(src, dst):
# This way we also preserve hardlinks between files in the tree.
bb.utils.mkdirhier(dst)
- cmd = "tar --xattrs --xattrs-include='*' -cf - -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst)
+ cmd = "tar --xattrs --xattrs-include='*' -cf - -S -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst)
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
def copyhardlinktree(src, dst):
@@ -98,7 +98,7 @@ def copyhardlinktree(src, dst):
if (os.stat(src).st_dev == os.stat(dst).st_dev):
# Need to copy directories only with tar first since cp will error if two
# writers try and create a directory at the same time
- cmd = "cd %s; find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
+ cmd = "cd %s; find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -S -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
source = ''
if os.path.isdir(src):