[OE-core] [PATCH v3] meta/oe/lib/path.py - check mount points, not device

Jason Plum jplum at devonit.com
Fri Jan 24 14:05:27 UTC 2014


Signed-off-by: Jason Plum <jplum at devonit.com>
---
  meta/lib/oe/path.py | 13 ++++++++++++-
  1 file changed, 12 insertions(+), 1 deletion(-)

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
-- 
1.8.5.3







More information about the Openembedded-core mailing list