@@ -92,7 +92,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 - -S -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst)
+ cmd = "tar --acls --xattrs --xattrs-include='*' -cf - -S -C %s -p . | tar --acls --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst)
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
def copyhardlinktree(src, dst):
@@ -119,7 +119,7 @@ def copyhardlinktree(src, dst):
if (canhard):
# 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 - -S -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 --acls --xattrs --xattrs-include='*' -cf - -S -C %s -p --no-recursion --files-from - | tar --acls --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
source = ''
if os.path.isdir(src):
@@ -130,7 +130,7 @@ def copyhardlinktree(src, dst):
else:
source = src
s_dir = os.getcwd()
- cmd = 'cp -afl --preserve=xattr %s %s' % (source, os.path.realpath(dst))
+ cmd = 'cp -afl --preserve=all %s %s' % (source, os.path.realpath(dst))
subprocess.check_output(cmd, shell=True, cwd=s_dir, stderr=subprocess.STDOUT)
else:
copytree(src, dst)
Extend `tar` command inside copytree() and copyhardlinktree() functions, with additional parameters, in order to support ACLs and xattr. The posix format doesn't need to be set in here, as GNU tar switches to it whenewer is uses --acls and/or --xattrs parameters. Additionaly change preservation of additional attributes for `cp` command to all (meaning mode, ownership, timestamps etc.) not only xattrs, which were previously. Signed-off-by: Piotr Łobacz <p.lobacz@welotec.com> --- meta/lib/oe/path.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)