[OE-core] [PATCH] oe/path.py: copyhardlinktree: don't overwrite existing symlinks

Ioan-Adrian Ratiu adrian.ratiu at ni.com
Wed Aug 16 11:13:55 UTC 2017


Starting with tar>=1.26 the default behaviour when extracting is to
overwrite symlinks and a '-h' flag was added for tar to follow them.

The primary use case for this is to allow ${DEPLOY_DIR_IPK/RPM/DEB} to
be symlinks and avoid copyhardlinktree replacing those symlinks with a
normal directory.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu at ni.com>
---
 meta/lib/oe/path.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 448a2b944e..1ea03d5d56 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -98,7 +98,7 @@ def copyhardlinktree(src, dst):
     if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
         # 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 --xattrs --xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, src, dst)
+        cmd = "cd %s; find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
         subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
         source = ''
         if os.path.isdir(src):
-- 
2.14.0




More information about the Openembedded-core mailing list