Changeset 5b5d6bf in rtems-source-builder


Ignore:
Timestamp:
Jun 16, 2015, 10:57:06 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
eddfda5
Parents:
18cea20
Message:

sb: Fix the downloader file:// URL to copy the file to the local path.

Location:
source-builder/sb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/download.py

    r18cea20 r5b5d6bf  
    263263    _local_path(source, pathkey, config)
    264264    #
    265     # Symlink.
    266     #
    267     source['symlink'] = source['local']
     265    # Get the paths sorted.
     266    #
     267    source['file'] = source['url'][6:]
    268268
    269269parsers = { 'http': _http_parser,
     
    511511
    512512def _file_downloader(url, local, config, opts):
    513     if path.exists(local):
    514         return True
    515     return path.isdir(url)
     513    try:
     514        path.copy(url[6:], local)
     515    except:
     516        return False
     517    return True
    516518
    517519downloaders = { 'http': _http_downloader,
  • source-builder/sb/path.py

    r18cea20 r5b5d6bf  
    167167        l += [join(p, name)]
    168168    return l
     169
     170def copy(src, dst):
     171    hsrc = host(src)
     172    hdst = host(dst)
     173    try:
     174        shutil.copy(hsrc, hdst)
     175    except OSError, why:
     176        if windows:
     177            if WindowsError is not None and isinstance(why, WindowsError):
     178                pass
     179        else:
     180            raise error.general('copying tree: %s -> %s: %s' % (hsrc, hdst, str(why)))
    169181
    170182def copy_tree(src, dst):
Note: See TracChangeset for help on using the changeset viewer.