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

Chris Johns chrisj at rtems.org
Mon Jan 27 21:45:02 UTC 2020


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

Author:    Vijay Kumar Banerjee <vijaykumar9597 at gmail.com>
Date:      Fri Jan 24 15:45:15 2020 +0530

rtemstoolkit/path: Add support to copy single file

---

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

diff --git a/rtemstoolkit/path.py b/rtemstoolkit/path.py
index 9401e99..b15164b 100644
--- a/rtemstoolkit/path.py
+++ b/rtemstoolkit/path.py
@@ -314,8 +314,12 @@ def copy_tree(src, dst):
     hsrc = host(src)
     hdst = host(dst)
 
-    if exists(src):
-        names = listdir(src)
+    if exists(hsrc):
+        if isdir(hsrc):
+            names = listdir(hsrc)
+        else:
+            names = [basename(hsrc)]
+            hsrc = dirname(hsrc)
     else:
         names = []
 



More information about the vc mailing list