[oe-commits] [openembedded-core] 04/08: oe.path: fix copyhardlinktree()

git at git.openembedded.org git at git.openembedded.org
Mon Sep 5 16:46:30 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 9cd83b689b5c7fcdbead9ac0c46c24fbe884c57a
Author: Joshua Lock <joshuagloe at gmail.com>
AuthorDate: Mon Sep 5 14:35:09 2016 +0100

    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.
    
    Signed-off-by: Joshua Lock <joshua.g.lock at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oe/path.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 631c3b4..06a5af2 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -79,12 +79,15 @@ def copyhardlinktree(src, dst):
         # writers try and create a directory at the same time
         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)
         subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+        source = ''
         if os.path.isdir(src):
             import glob
             if len(glob.glob('%s/.??*' % src)) > 0:
-                src = src + '/.??* '
-            src = src + '/*'
-        cmd = 'cp -afl --preserve=xattr %s %s' % (src, dst)
+                source = '%s/.??* ' % src
+            source = source + '%s/*' % src
+        else:
+            source = src
+        cmd = 'cp -afl --preserve=xattr %s %s' % (source, dst)
         subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
     else:
         copytree(src, dst)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list