From a5b57bda826bb6c5e6d4fd7a8a2ed999aeb46ee0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Barouski Date: Thu, 7 Jul 2016 15:47:09 -0700 Subject: qmi-codegen: fixed multiple common-refs processing --- build-aux/qmi-codegen/Container.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'build-aux') 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. -- cgit v1.1