From 8597a616f33136204f1230d226fbc45e3ea84932 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Fri, 18 Dec 2015 13:46:31 +0200 Subject: 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) (From OE-Core rev: fa0424ee742a6b331f1c6462eb69fecba6dc7f86) Signed-off-by: Ed Bartosh Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- scripts/lib/devtool/sdk.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/lib/devtool') 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' -- cgit v1.2.3-54-g00ecf