summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-12-18 13:46:31 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-28 09:24:54 +0000
commite5b841420b9fdd33829f7665a62cd06a3017f7e6 (patch)
tree5ced32abc9d826aaf58f5150dfb02036d9cf09b3
parent161bb3409edee21827cf594cc011fe88185f1496 (diff)
downloadopenembedded-core-e5b841420b9fdd33829f7665a62cd06a3017f7e6.tar.gz
openembedded-core-e5b841420b9fdd33829f7665a62cd06a3017f7e6.tar.bz2
openembedded-core-e5b841420b9fdd33829f7665a62cd06a3017f7e6.zip
devtool: use cp instead of shutil.copytree
Copied layers with 'cp -a' instead of calling shutil.copytree as copytree fails to copy broken symlinks. More pythonic fix would be to use copytree with 'ignore' parameter, but this could slow down copying complex directory structures. [YOCTO #8825] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--scripts/lib/devtool/sdk.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/lib/devtool/sdk.py b/scripts/lib/devtool/sdk.py
index f08f0eee7c..47b9a7e1fc 100644
--- a/scripts/lib/devtool/sdk.py
+++ b/scripts/lib/devtool/sdk.py
@@ -128,7 +128,10 @@ def sdk_update(args, config, basepath, workspace):
new_layers_dir = os.path.join(args.updateserver, 'layers')
old_layers_dir = os.path.join(basepath, 'layers')
shutil.rmtree(old_layers_dir)
- shutil.copytree(new_layers_dir, old_layers_dir)
+ ret = subprocess.call("cp -a %s %s" % (new_layers_dir, old_layers_dir), shell=True)
+ if ret != 0:
+ logger.error("Copying %s to %s failed" % (new_layers_dir, old_layers_dir))
+ return ret
else:
# devtool sdk-update http://myhost/sdk
tmpsdk_dir = '/tmp/sdk-ext'