summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2015-06-16 20:57:06 +1000
committerChris Johns <chrisj@rtems.org>2015-06-16 20:57:06 +1000
commit5b5d6bff74fed9da7626805620670cfd22970c2f (patch)
tree1678f1f5e6e2dd3d5c903f89495b8f1ecc697f36
parentdevel/qemu: Add support to build VDE if installed. (diff)
downloadrtems-source-builder-5b5d6bff74fed9da7626805620670cfd22970c2f.tar.bz2
sb: Fix the downloader file:// URL to copy the file to the local path.
-rw-r--r--source-builder/sb/download.py12
-rw-r--r--source-builder/sb/path.py12
2 files changed, 19 insertions, 5 deletions
diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py
index 5622d4a..624151b 100644
--- a/source-builder/sb/download.py
+++ b/source-builder/sb/download.py
@@ -262,9 +262,9 @@ def _file_parser(source, pathkey, config, opts):
#
_local_path(source, pathkey, config)
#
- # Symlink.
+ # Get the paths sorted.
#
- source['symlink'] = source['local']
+ source['file'] = source['url'][6:]
parsers = { 'http': _http_parser,
'ftp': _http_parser,
@@ -510,9 +510,11 @@ def _cvs_downloader(url, local, config, opts):
return True
def _file_downloader(url, local, config, opts):
- if path.exists(local):
- return True
- return path.isdir(url)
+ try:
+ path.copy(url[6:], local)
+ except:
+ return False
+ return True
downloaders = { 'http': _http_downloader,
'ftp': _http_downloader,
diff --git a/source-builder/sb/path.py b/source-builder/sb/path.py
index 5fa8aef..824b8f5 100644
--- a/source-builder/sb/path.py
+++ b/source-builder/sb/path.py
@@ -167,6 +167,18 @@ def expand(name, paths):
l += [join(p, name)]
return l
+def copy(src, dst):
+ hsrc = host(src)
+ hdst = host(dst)
+ try:
+ shutil.copy(hsrc, hdst)
+ except OSError, why:
+ if windows:
+ if WindowsError is not None and isinstance(why, WindowsError):
+ pass
+ else:
+ raise error.general('copying tree: %s -> %s: %s' % (hsrc, hdst, str(why)))
+
def copy_tree(src, dst):
trace = False