summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/path.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-02-04 18:35:33 +1100
committerChris Johns <chrisj@rtems.org>2014-02-04 18:35:33 +1100
commitedf60aa82f73b14bd8dfb10693aeeac3ee12ae74 (patch)
tree77ef196d76bcf2d0a4ce972351306deb0ef8d249 /source-builder/sb/path.py
parentsb: Fix downloader url parsing and add submodule git support. (diff)
downloadrtems-source-builder-edf60aa82f73b14bd8dfb10693aeeac3ee12ae74.tar.bz2
sb: Do not assume the src is valid.
Diffstat (limited to 'source-builder/sb/path.py')
-rw-r--r--source-builder/sb/path.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/source-builder/sb/path.py b/source-builder/sb/path.py
index 6f72dbc..20ab73c 100644
--- a/source-builder/sb/path.py
+++ b/source-builder/sb/path.py
@@ -143,7 +143,10 @@ def copy_tree(src, dst):
hsrc = host(src)
hdst = host(dst)
- names = os.listdir(src)
+ if os.path.exists(src):
+ names = os.listdir(src)
+ else:
+ names = []
if not os.path.isdir(dst):
os.makedirs(dst)
@@ -178,8 +181,9 @@ def copy_tree(src, dst):
try:
shutil.copystat(src, dst)
except OSError, why:
- if WindowsError is not None and isinstance(why, WindowsError):
- pass
+ if windows:
+ if WindowsError is not None and isinstance(why, WindowsError):
+ pass
else:
raise error.general('copying tree: %s -> %s: %s' % (src, dst, str(why)))