summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/path.py
diff options
context:
space:
mode:
authorJoshua Lock <joshuagloe@gmail.com>2016-09-05 14:35:09 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-06 10:24:04 +0100
commit822c708e8fd007cdefccbdbcbf7dcbe3256dcf5a (patch)
tree01d9650cd8cac70e16f96c7f4aa72b4b0854f97e /meta/lib/oe/path.py
parentf5b4ca2ad7a75a1b339a931ebb35d9238ba47b4b (diff)
downloadpoky-822c708e8fd007cdefccbdbcbf7dcbe3256dcf5a.tar.gz
oe.path: fix copyhardlinktree()
The change to preserve extended attributes in copytree() and copyhardlinktree() (e591d69103a40ec4f76d1132a6039d9cb1555103) resulted in an incorrect cp invocation in copyhardlinktree() when the source directory contained hidden files. This was because the passed src was modified in place but some code paths expected it to remain unmodified from the passed value. Resolve the issue by constructing a new source string, rather than modifying the passed in string. (From OE-Core rev: 2b9fdd8448c2c29418d1c3fca9fe1789466f09b4) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/path.py')
-rw-r--r--meta/lib/oe/path.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 631c3b430c..06a5af2659 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -79,12 +79,15 @@ def copyhardlinktree(src, dst):
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 --xattrs --xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -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 source = ''
82 if os.path.isdir(src): 83 if os.path.isdir(src):
83 import glob 84 import glob
84 if len(glob.glob('%s/.??*' % src)) > 0: 85 if len(glob.glob('%s/.??*' % src)) > 0:
85 src = src + '/.??* ' 86 source = '%s/.??* ' % src
86 src = src + '/*' 87 source = source + '%s/*' % src
87 cmd = 'cp -afl --preserve=xattr %s %s' % (src, dst) 88 else:
89 source = src
90 cmd = 'cp -afl --preserve=xattr %s %s' % (source, dst)
88 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) 91 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
89 else: 92 else:
90 copytree(src, dst) 93 copytree(src, dst)