diff options
author | Chris Johns <chrisj@rtems.org> | 2019-09-19 09:40:36 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2019-09-19 09:40:36 +1000 |
commit | 841120ec9598bae88c1ee745c7574e46f759212e (patch) | |
tree | 7b62d6e9b4183f5206b8476ed36cad121df78b29 | |
parent | 6: Update unstable RTEMS 6 tool chain (diff) | |
download | rtems-source-builder-841120ec9598bae88c1ee745c7574e46f759212e.tar.bz2 |
sb: Detect duplicate adds of patches.
-rw-r--r-- | source-builder/sb/sources.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source-builder/sb/sources.py b/source-builder/sb/sources.py index c5f0037..a619778 100644 --- a/source-builder/sb/sources.py +++ b/source-builder/sb/sources.py @@ -34,15 +34,21 @@ def add(label, args, macros, error): if len(args) < 2: error('%%%s requires at least 2 arguments' % (label)) _map = '%s-%s' % (label, args[0]) + _value = ' '.join(args[1:]) macros.create_map(_map) index = 0 while True: key = _make_key(label, index) if key not in macros.map_keys(_map): break + macros.set_read_map(_map) + value = macros.get_value(key) + macros.unset_read_map(_map) + if value == _value: + error('%%%s duplicate add: %s' % (label, _value)) index += 1 macros.set_write_map(_map) - macros.define(key, ' '.join(args[1:])) + macros.define(key, _value) macros.unset_write_map() return None |