summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/sources.py
diff options
context:
space:
mode:
Diffstat (limited to 'source-builder/sb/sources.py')
-rw-r--r--source-builder/sb/sources.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/source-builder/sb/sources.py b/source-builder/sb/sources.py
index 7b4edfd..d8f6f8d 100644
--- a/source-builder/sb/sources.py
+++ b/source-builder/sb/sources.py
@@ -72,3 +72,17 @@ def process(label, args, macros, error):
elif args[0] == 'setup':
return setup(label, args[1:], macros, error)
error('invalid %%%s command: %s' % (label, args[0]))
+
+def hash(args, macros, error):
+ args = _args(args)
+ if len(args) != 3:
+ error('invalid number of hash args')
+ _map = 'hashes'
+ _file = macros.expand(args[1])
+ if _file in macros.map_keys(_map):
+ error('hash already set: %s' % (args[1]))
+ macros.create_map(_map)
+ macros.set_write_map(_map)
+ macros.define(_file, '%s %s' % (args[0], args[2]))
+ macros.unset_write_map()
+ return None