summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/path.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index faa0f61fab..4f8b66c2f3 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -85,13 +85,18 @@ def copytree(src, dst):
85 check_output(cmd, shell=True, stderr=subprocess.STDOUT) 85 check_output(cmd, shell=True, stderr=subprocess.STDOUT)
86 86
87def copyhardlinktree(src, dst): 87def copyhardlinktree(src, dst):
88 """ Make the hard link when possible, otherwise copy. """
88 bb.utils.mkdirhier(dst) 89 bb.utils.mkdirhier(dst)
90 src_bak = src
89 if os.path.isdir(src): 91 if os.path.isdir(src):
90 if not len(os.listdir(src)): 92 if not len(os.listdir(src)):
91 return 93 return
92 src = src + "/*" 94 src = src + "/*"
93 cmd = 'cp -al %s %s' % (src, dst) 95 if (os.stat(src_bak).st_dev == os.stat(dst).st_dev):
94 check_output(cmd, shell=True, stderr=subprocess.STDOUT) 96 cmd = 'cp -afl %s %s' % (src, dst)
97 check_output(cmd, shell=True, stderr=subprocess.STDOUT)
98 else:
99 copytree(src_bak, dst)
95 100
96def remove(path, recurse=True): 101def remove(path, recurse=True):
97 """Equivalent to rm -f or rm -rf""" 102 """Equivalent to rm -f or rm -rf"""