[rtems-tools commit] rtemstoolkit/path : Add support to copy single files

Chris Johns chrisj at rtems.org
Sat Nov 17 01:31:56 UTC 2018


Module:    rtems-tools
Branch:    master
Commit:    f9a17cd2a1ba3a03bc167ccd91202698e9d86e5e
Changeset: http://git.rtems.org/rtems-tools/commit/?id=f9a17cd2a1ba3a03bc167ccd91202698e9d86e5e

Author:    Vijay Kumar Banerjee <vijaykumar9597 at gmail.com>
Date:      Wed Nov  7 13:29:09 2018 +0530

rtemstoolkit/path : Add support to copy single files

---

 rtemstoolkit/path.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/rtemstoolkit/path.py b/rtemstoolkit/path.py
index 760f4bd..83fb361 100644
--- a/rtemstoolkit/path.py
+++ b/rtemstoolkit/path.py
@@ -191,10 +191,11 @@ def copy_tree(src, dst):
     hsrc = host(src)
     hdst = host(dst)
 
-    if os.path.exists(src):
+    if os.path.exists(src) and os.path.isdir(src):
         names = os.listdir(src)
     else:
-        name = []
+        names = [basename(src)]
+        src = dirname(src)
 
     if not os.path.isdir(dst):
         os.makedirs(dst)



More information about the vc mailing list