aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAliaksandr Barouski <alex.borovsky@gmail.com>2016-07-07 15:47:09 -0700
committerAleksander Morgado <aleksander@aleksander.es>2016-09-05 22:18:02 +0200
commita5b57bda826bb6c5e6d4fd7a8a2ed999aeb46ee0 (patch)
treead2bc4a3a783c528b2fbc1d1dd1135d8b6f17ae6
parenta309b4dd537eca51bc392facdf1a470d7ea32c80 (diff)
qmi-codegen: fixed multiple common-refs processing
-rw-r--r--build-aux/qmi-codegen/Container.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/build-aux/qmi-codegen/Container.py b/build-aux/qmi-codegen/Container.py
index d79722b..46e4ddf 100644
--- a/build-aux/qmi-codegen/Container.py
+++ b/build-aux/qmi-codegen/Container.py
@@ -58,6 +58,7 @@ class Container:
if dictionary is not None:
self.fields = []
+ new_dict = []
# First, look for references to common types
for field_dictionary in dictionary:
if 'common-ref' in field_dictionary:
@@ -69,12 +70,13 @@ class Container:
copy = dict(common)
if 'prerequisites' in field_dictionary:
copy['prerequisites'] = field_dictionary['prerequisites']
- dictionary.remove(field_dictionary)
- dictionary.append(copy)
+ new_dict.append(copy)
break
else:
raise RuntimeError('Common type \'%s\' not found' % field_dictionary['name'])
-
+ else:
+ new_dict.append(field_dictionary)
+ dictionary = new_dict
# We need to sort the fields, so that the ones with prerequisites are
# include after the prerequisites themselves. Note: we don't currently
# support complex setups yet.