mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb: Fix the downloader file:// URL to copy the file to the local path.
This commit is contained in:
parent
18cea20a12
commit
5b5d6bff74
@ -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,
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user