On 01/20/2014 11:22 AM, Jason Plum wrote:
Signed-off-by: Jason Plum <[email protected]>
---
  meta/lib/oe/path.py | 13 ++++++++++++-
  1 file changed, 12 insertions(+), 1 deletion(-)


This patch is still not applying cleanly to master, I am also still a little concerned if this will affect performance since it's used often in sstate code.

Have you compared build times with and without this patch?

Sau!

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 46783f8..dab20fc 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -90,7 +90,7 @@ def copyhardlinktree(src, dst):
      if os.path.isdir(src) and not len(os.listdir(src)):
          return        

-    if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
+    if (getmount(src) ==  getmount(dst)):
          # 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 -cf - -C %s -p --files-from 
- --no-recursion | tar -xf - -C %s' % (src, src, dst)
@@ -257,3 +257,14 @@ def realpath(file, root, use_physdir = True, loop_cnt = 
100, assume_dir = False)
          raise

      return file
+
+def getmount(path):
+    """ getmount takes a path parameter, uses os.path.realpath with 
os.path.abspath to
+    handle symlink resolution, and returns the path to the mount point of the 
input path
+    """
+    path = os.path.realpath(os.path.abspath(path))
+    while path != os.path.sep:
+        if os.path.ismount(path):
+            return path
+        path = os.path.abspath(os.path.join(path, os.pardir))
+    return path
\ No newline at end of file

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to