summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/download.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-05-13 23:26:09 +1000
committerChris Johns <chrisj@rtems.org>2014-05-13 23:26:09 +1000
commit9a15c40e1b2ac56a678e79519e1e78160009af92 (patch)
tree308f3f407a06c4073612b813d4d40ed0c5c5c60e /source-builder/sb/download.py
parent4.11/rtems-lm32: Use gcc-4.9.0 and fix gdb simulator build on Windows. (diff)
downloadrtems-source-builder-9a15c40e1b2ac56a678e79519e1e78160009af92.tar.bz2
sb: Implement %source and %patch to manage source and patches.
Remove the numbered source and patches and automatically manage sources and patches. This removes the overhead in maintaining large collections of patches.
Diffstat (limited to 'source-builder/sb/download.py')
-rw-r--r--source-builder/sb/download.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py
index 7457235..3386aea 100644
--- a/source-builder/sb/download.py
+++ b/source-builder/sb/download.py
@@ -40,12 +40,16 @@ def _http_parser(source, config, opts):
#
esl = source['ext'].split('.')
if esl[-1:][0] == 'gz':
+ source['compressed-type'] = 'gzip'
source['compressed'] = '%{__gzip} -dc'
elif esl[-1:][0] == 'bz2':
+ source['compressed-type'] = 'bzip2'
source['compressed'] = '%{__bzip2} -dc'
elif esl[-1:][0] == 'zip':
+ source['compressed-type'] = 'zip'
source['compressed'] = '%{__zip} -u'
elif esl[-1:][0] == 'xz':
+ source['compressed-type'] = 'xz'
source['compressed'] = '%{__xz} -dc'
def _patchworks_parser(source, config, opts):
@@ -138,6 +142,9 @@ def parse_url(url, pathkey, config, opts):
source['path'] = url[:colon + 3] + path.dirname(url[colon + 3:])
source['file'] = path.basename(url)
source['name'], source['ext'] = path.splitext(source['file'])
+ if source['name'].endswith('.tar'):
+ source['name'] = source['name'][:-4]
+ source['ext'] = '.tar' + source['ext']
#
# Get the file. Checks the local source directory first.
#