diff options
author | Chris Johns <chrisj@rtems.org> | 2014-07-29 16:35:43 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-07-29 16:35:43 +1000 |
commit | a083b52921a86a3bc49e2cc1d7d102612694557c (patch) | |
tree | b04b1fe0d3f5c037fac9f61f57f40f96712085c8 /source-builder/sb/config.py | |
parent | sb: Add visual feedback for http type downloads. (diff) | |
download | rtems-source-builder-a083b52921a86a3bc49e2cc1d7d102612694557c.tar.bz2 |
Add checksum support for downloaded files.
File download by http, ftp, pw support checksum. The %hash
directive provides a means of setting a hash used to
checksum the file.
Files on disk or just downloaded are checked.
Diffstat (limited to 'source-builder/sb/config.py')
-rw-r--r-- | source-builder/sb/config.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py index 5eb2d2a..baba751 100644 --- a/source-builder/sb/config.py +++ b/source-builder/sb/config.py @@ -229,8 +229,9 @@ class file: _ignore = [ re.compile('%setup'), re.compile('%configure'), - re.compile('%source[0-9]*'), - re.compile('%patch[0-9]*'), + re.compile('%source'), + re.compile('%patch'), + re.compile('%hash'), re.compile('%select'), re.compile('%disable') ] @@ -671,6 +672,9 @@ class file: def _sources(self, ls): return sources.process(ls[0][1:], ls[1:], self.macros, self._error) + def _hash(self, ls): + return sources.hash(ls[1:], self.macros, self._error) + def _define(self, config, ls): if len(ls) <= 1: log.warning('invalid macro definition') @@ -892,6 +896,11 @@ class file: d = self._sources(ls) if d is not None: return ('data', d) + elif ls[0] == '%hash': + if isvalid: + d = self._hash(ls) + if d is not None: + return ('data', d) elif ls[0] == '%patch': if isvalid: self._select(config, ls) |