[rtems-source-builder commit] sb: Detect duplicate adds of patches.
Chris Johns
chrisj at rtems.org
Wed Sep 18 23:47:58 UTC 2019
Module: rtems-source-builder
Branch: master
Commit: 841120ec9598bae88c1ee745c7574e46f759212e
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=841120ec9598bae88c1ee745c7574e46f759212e
Author: Chris Johns <chrisj at rtems.org>
Date: Thu Sep 19 09:40:36 2019 +1000
sb: Detect duplicate adds of patches.
---
source-builder/sb/sources.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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
More information about the vc
mailing list