aboutsummaryrefslogtreecommitdiff
path: root/linaro_image_tools/media_create/boards.py
diff options
context:
space:
mode:
authorJames Tunnicliffe <james.tunnicliffe@linaro.org>2012-09-10 11:20:54 +0100
committerJames Tunnicliffe <james.tunnicliffe@linaro.org>2012-09-10 11:20:54 +0100
commitca9ddb8e4e7109b48dab5bdfe6f579dbd373dc42 (patch)
tree050b37812f633d742b1512197c796fea7e440b20 /linaro_image_tools/media_create/boards.py
parentfa763179709cfa0be81e611faff895bd0d3835ce (diff)
Updated copy_file code to make missing directories and test rename file support.
Diffstat (limited to 'linaro_image_tools/media_create/boards.py')
-rw-r--r--linaro_image_tools/media_create/boards.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/linaro_image_tools/media_create/boards.py b/linaro_image_tools/media_create/boards.py
index d54f10e..aee0722 100644
--- a/linaro_image_tools/media_create/boards.py
+++ b/linaro_image_tools/media_create/boards.py
@@ -943,6 +943,12 @@ class BoardConfig(object):
for source_path, dest_path in file_info.iteritems():
source = cls.hardwarepack_handler.get_file_from_package(
source_path, source_package)
+ dest_path = dest_path.lstrip("/\\")
+ dirname = os.path.dirname(dest_path)
+ dirname = os.path.join(boot_disk, dirname)
+ if not os.path.exists(dirname):
+ cmd_runner.run(["mkdir", "-p", dirname],
+ as_root=True).wait()
proc = cmd_runner.run(
['cp', '-v', source,
os.path.join(boot_disk, dest_path)], as_root=True)