[OE-core] [PATCH 1/3] oeqa/utils/commands.py: Add oeqa_copy function

mariano.lopez at linux.intel.com mariano.lopez at linux.intel.com
Tue Jul 26 07:39:06 UTC 2016


From: Mariano Lopez <mariano.lopez at linux.intel.com>

This new function is just a call to shutil.copy2() with
follow_symlinks set to False. This function is needed
when using shutil.copytree() to preserve the symlinks.

[YOCTO #9932]

Signed-off-by: Mariano Lopez <mariano.lopez at linux.intel.com>
---
 meta/lib/oeqa/utils/commands.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 4f79d15..eedc4d7 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -18,6 +18,7 @@ from oeqa.utils import CommandError
 from oeqa.utils import ftools
 import re
 import contextlib
+import shutil
 # Export test doesn't require bb
 try:
     import bb
@@ -273,3 +274,11 @@ def updateEnv(env_file):
     for line in result.output.split("\0"):
         (key, _, value) = line.partition("=")
         os.environ[key] = value
+
+def oeqa_copy(src, dst):
+    """
+    Copy files and symlinks trying to preserve metadata.
+    """
+
+    shutil.copy2(src, dst, follow_symlinks=False)
+
-- 
2.6.6




More information about the Openembedded-core mailing list