diff options
Diffstat (limited to 'meta/lib/oe/path.py')
-rw-r--r-- | meta/lib/oe/path.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index 3c07df33d4..631c3b430c 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py | |||
@@ -65,7 +65,7 @@ def copytree(src, dst): | |||
65 | # This way we also preserve hardlinks between files in the tree. | 65 | # This way we also preserve hardlinks between files in the tree. |
66 | 66 | ||
67 | bb.utils.mkdirhier(dst) | 67 | bb.utils.mkdirhier(dst) |
68 | cmd = 'tar -cf - -C %s -p . | tar -xf - -C %s' % (src, dst) | 68 | cmd = "tar --xattrs --xattrs-include='*' -cf - -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst) |
69 | subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) | 69 | subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) |
70 | 70 | ||
71 | def copyhardlinktree(src, dst): | 71 | def copyhardlinktree(src, dst): |
@@ -77,9 +77,14 @@ def copyhardlinktree(src, dst): | |||
77 | if (os.stat(src).st_dev == os.stat(dst).st_dev): | 77 | if (os.stat(src).st_dev == os.stat(dst).st_dev): |
78 | # Need to copy directories only with tar first since cp will error if two | 78 | # Need to copy directories only with tar first since cp will error if two |
79 | # writers try and create a directory at the same time | 79 | # writers try and create a directory at the same time |
80 | cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --no-recursion --files-from - | tar -xf - -C %s' % (src, src, dst) | 80 | cmd = "cd %s; find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, src, dst) |
81 | subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) | 81 | subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) |
82 | cmd = 'cd %s; find . -print0 | cpio --null -pdlu %s' % (src, dst) | 82 | if os.path.isdir(src): |
83 | import glob | ||
84 | if len(glob.glob('%s/.??*' % src)) > 0: | ||
85 | src = src + '/.??* ' | ||
86 | src = src + '/*' | ||
87 | cmd = 'cp -afl --preserve=xattr %s %s' % (src, dst) | ||
83 | subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) | 88 | subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) |
84 | else: | 89 | else: |
85 | copytree(src, dst) | 90 | copytree(src, dst) |