summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
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:44:33 +0100
commita1b4b7c0b493968a6f9d519a3a37d87466432f0d (patch)
treeed38eb9155d544ce0cd6afecbb66583230813b09 /meta/lib/oe
parent899a3694dea8dc43dcba0b1d1e0aafb446fbba20 (diff)
downloadpoky-a1b4b7c0b493968a6f9d519a3a37d87466432f0d.tar.gz
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. (From OE-Core rev: 055402e5504f041c346571e243c7cf0894955cad) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/path.py4
1 files changed, 2 insertions, 2 deletions
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):
86 # This way we also preserve hardlinks between files in the tree. 86 # This way we also preserve hardlinks between files in the tree.
87 87
88 bb.utils.mkdirhier(dst) 88 bb.utils.mkdirhier(dst)
89 cmd = "tar --xattrs --xattrs-include='*' -cf - -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst) 89 cmd = "tar --xattrs --xattrs-include='*' -cf - -S -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst)
90 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) 90 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
91 91
92def copyhardlinktree(src, dst): 92def copyhardlinktree(src, dst):
@@ -98,7 +98,7 @@ def copyhardlinktree(src, dst):
98 if (os.stat(src).st_dev == os.stat(dst).st_dev): 98 if (os.stat(src).st_dev == os.stat(dst).st_dev):
99 # Need to copy directories only with tar first since cp will error if two 99 # Need to copy directories only with tar first since cp will error if two
100 # writers try and create a directory at the same time 100 # writers try and create a directory at the same time
101 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) 101 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)
102 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) 102 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
103 source = '' 103 source = ''
104 if os.path.isdir(src): 104 if os.path.isdir(src):