Changeset 587aa5f in rtems-source-builder


Ignore:
Timestamp:
Feb 12, 2014, 4:26:07 AM (6 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
70cc3b0
Parents:
faa3583
Message:

sb: Add patchworks support via the pw://... URL.

File:
1 edited

Legend:

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

    rfaa3583 r587aa5f  
    4848    elif esl[-1:][0] == 'xz':
    4949        source['compressed'] = '%{__xz} -dc'
     50
     51def _patchworks_parser(source, config, opts):
     52    source['url'] = 'http%s' % (source['path'][2:])
    5053
    5154def _git_parser(source, config, opts):
     
    119122parsers = { 'http': _http_parser,
    120123            'ftp':  _http_parser,
     124            'pw':   _patchworks_parser,
    121125            'git':  _git_parser,
    122126            'cvs':  _cvs_parser,
     
    129133    source = {}
    130134    source['url'] = url
    131     source['path'] = path.dirname(url)
     135    colon = url.find(':')
     136    if url[colon + 1:colon + 3] != '//':
     137        raise error.general('malforned URL: %s' % (url))
     138    source['path'] = url[:colon + 3] + path.dirname(url[colon + 3:])
    132139    source['file'] = path.basename(url)
    133140    source['name'], source['ext'] = path.splitext(source['file'])
     
    292299downloaders = { 'http': _http_downloader,
    293300                'ftp':  _http_downloader,
     301                'pw':   _http_downloader,
    294302                'git':  _git_downloader,
    295303                'cvs':  _cvs_downloader,
Note: See TracChangeset for help on using the changeset viewer.