aboutsummaryrefslogtreecommitdiffstats
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>2016-01-15 15:41:31 +0000
commitfa0424ee742a6b331f1c6462eb69fecba6dc7f86 (patch)
tree78e24ca4eb6ae590c6b0ce13e6f245891292d850
parent36d4b0903890bc793608759b3351a5de4229de11 (diff)
downloadopenembedded-core-contrib-fa0424ee742a6b331f1c6462eb69fecba6dc7f86.tar.gz
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] (From OE-Core master rev: e5b841420b9fdd33829f7665a62cd06a3017f7e6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 84b9f32a57..ae310489e6 100644
--- a/scripts/lib/devtool/sdk.py
+++ b/scripts/lib/devtool/sdk.py
@@ -132,7 +132,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'