diff options
author | Chris Johns <chrisj@rtems.org> | 2014-02-12 15:26:07 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-02-12 15:26:07 +1100 |
commit | 587aa5fb74d5cb052f7b7920213a2171e4496852 (patch) | |
tree | ebf4c2366eabd6c0e8757db5e365b3c7e3c742ed /source-builder/sb/download.py | |
parent | sb: Fixed from Fedora testing. (diff) | |
download | rtems-source-builder-587aa5fb74d5cb052f7b7920213a2171e4496852.tar.bz2 |
sb: Add patchworks support via the pw://... URL.
Diffstat (limited to 'source-builder/sb/download.py')
-rw-r--r-- | source-builder/sb/download.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py index 9259f51..53de8df 100644 --- a/source-builder/sb/download.py +++ b/source-builder/sb/download.py @@ -48,6 +48,9 @@ def _http_parser(source, config, opts): elif esl[-1:][0] == 'xz': source['compressed'] = '%{__xz} -dc' +def _patchworks_parser(source, config, opts): + source['url'] = 'http%s' % (source['path'][2:]) + def _git_parser(source, config, opts): # # Symlink. @@ -118,6 +121,7 @@ def _file_parser(source, config, opts): parsers = { 'http': _http_parser, 'ftp': _http_parser, + 'pw': _patchworks_parser, 'git': _git_parser, 'cvs': _cvs_parser, 'file': _file_parser } @@ -128,7 +132,10 @@ def parse_url(url, pathkey, config, opts): # source = {} source['url'] = url - source['path'] = path.dirname(url) + colon = url.find(':') + if url[colon + 1:colon + 3] != '//': + raise error.general('malforned URL: %s' % (url)) + source['path'] = url[:colon + 3] + path.dirname(url[colon + 3:]) source['file'] = path.basename(url) source['name'], source['ext'] = path.splitext(source['file']) # @@ -291,6 +298,7 @@ def _file_downloader(url, local, config, opts): downloaders = { 'http': _http_downloader, 'ftp': _http_downloader, + 'pw': _http_downloader, 'git': _git_downloader, 'cvs': _cvs_downloader, 'file': _file_downloader } |