From 313593827334bc59d5cce60d545d104084c9d180 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Fri, 15 Nov 2013 12:36:17 +0000 Subject: Fix conflicting strata problem The _traverse_specs function which is used by morph edit does not update refs for strata that depend on the stratum being edited. --- morphlib/morphset.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/morphlib/morphset.py b/morphlib/morphset.py index 9ef1e804..e27b4b1f 100644 --- a/morphlib/morphset.py +++ b/morphlib/morphset.py @@ -15,7 +15,7 @@ # # =*= License: GPL-2 =*= - +import sets import morphlib @@ -155,6 +155,7 @@ class MorphologySet(object): ''' altered_references = {} + altered_strata = sets.Set() def process_spec_list(m, kind): specs = m[kind] @@ -166,12 +167,24 @@ class MorphologySet(object): m.dirty = True altered_references[orig_spec] = spec + return m.dirty + for m in self.morphologies: if m['kind'] == 'system': process_spec_list(m, 'strata') elif m['kind'] == 'stratum': - process_spec_list(m, 'build-depends') - process_spec_list(m, 'chunks') + if process_spec_list(m, 'build-depends'): + altered_strata.add(m['name']) + + if process_spec_list(m, 'chunks'): + altered_strata.add(m['name']) + + for m in self.morphologies: + if m['kind'] == 'system': + specs = m['strata'] + for spec in specs: + if spec['morph'] in altered_strata: + cb_process(m, 'strata', spec) for m in self.morphologies: tup = (m.repo_url, m.ref, m.filename[:-len('.morph')]) -- cgit v1.2.1