summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/setbuilder.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-07-29 16:35:43 +1000
committerChris Johns <chrisj@rtems.org>2014-07-29 16:35:43 +1000
commita083b52921a86a3bc49e2cc1d7d102612694557c (patch)
treeb04b1fe0d3f5c037fac9f61f57f40f96712085c8 /source-builder/sb/setbuilder.py
parentsb: Add visual feedback for http type downloads. (diff)
downloadrtems-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/setbuilder.py')
-rw-r--r--source-builder/sb/setbuilder.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/source-builder/sb/setbuilder.py b/source-builder/sb/setbuilder.py
index 7b285f2..6e7e7cc 100644
--- a/source-builder/sb/setbuilder.py
+++ b/source-builder/sb/setbuilder.py
@@ -236,6 +236,8 @@ class buildset:
self.bset_pkg = self.macros.expand(ls[1].strip())
self.macros['package'] = self.bset_pkg
elif ls[0][0] == '%':
+ def err(msg):
+ raise error.general('%s:%d: %s' % (self.bset, lc, msg))
if ls[0] == '%define':
if len(ls) > 2:
self.macros.define(ls[1].strip(),
@@ -249,10 +251,10 @@ class buildset:
self.macros.undefine(ls[1].strip())
elif ls[0] == '%include':
configs += self.parse(ls[1].strip())
- elif ls[0] == '%patch' or ls[0] == '%source':
- def err(msg):
- raise error.general('%s:%d: %s' % (self.bset, lc, msg))
+ elif ls[0] in ['%patch', '%source']:
sources.process(ls[0][1:], ls[1:], self.macros, err)
+ elif ls[0] == '%hash':
+ sources.hash(ls[1:], self.macros, err)
else:
l = l.strip()
c = build.find_config(l, self.configs)