specs: save/restore concrete & patches when exporting/importing Specs
This commit is contained in:
parent
7f224b616d
commit
037457adc9
@ -1462,6 +1462,13 @@ def to_node_dict(self, hash_function=None, all_deps=False):
|
|||||||
'module': self.external_module
|
'module': self.external_module
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d['concrete'] = self._concrete
|
||||||
|
|
||||||
|
if 'patches' in self.variants:
|
||||||
|
variant = self.variants['patches']
|
||||||
|
if hasattr(variant, '_patches_in_order_of_appearance'):
|
||||||
|
d['patches'] = variant._patches_in_order_of_appearance
|
||||||
|
|
||||||
# TODO: restore build dependencies here once we have less picky
|
# TODO: restore build dependencies here once we have less picky
|
||||||
# TODO: concretization.
|
# TODO: concretization.
|
||||||
if all_deps:
|
if all_deps:
|
||||||
@ -1553,6 +1560,19 @@ def from_node_dict(node):
|
|||||||
spec.external_path = None
|
spec.external_path = None
|
||||||
spec.external_module = None
|
spec.external_module = None
|
||||||
|
|
||||||
|
if 'concrete' in node:
|
||||||
|
spec._concrete = node['concrete']
|
||||||
|
|
||||||
|
if 'patches' in node:
|
||||||
|
patches = node['patches']
|
||||||
|
if len(patches) > 0:
|
||||||
|
mvar = spec.variants.setdefault(
|
||||||
|
'patches', MultiValuedVariant('patches', ())
|
||||||
|
)
|
||||||
|
mvar.value = patches
|
||||||
|
# FIXME: Monkey patches mvar to store patches order
|
||||||
|
mvar._patches_in_order_of_appearance = patches
|
||||||
|
|
||||||
# Don't read dependencies here; from_node_dict() is used by
|
# Don't read dependencies here; from_node_dict() is used by
|
||||||
# from_yaml() to read the root *and* each dependency spec.
|
# from_yaml() to read the root *and* each dependency spec.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user