=== modified file 'aptsources/distinfo.py' --- aptsources/distinfo.py 2008-05-28 10:08:14 +0000 +++ aptsources/distinfo.py 2008-07-25 14:02:15 +0000 @@ -40,6 +40,7 @@ def __init__(self): self.name = None self.child = False + self.parent = None # ref to parent template self.match_name = None self.description = None self.base_uri = None @@ -164,6 +165,11 @@ self.metarelease_uri = value elif field == 'Suite': if template: + # reuse some properties of the parent template + if template.match_uri == None and template.child: + template.match_uri = template.parent.match_uri + if template.mirror_set == {} and template.child: + template.mirror_set = template.parent.mirror_set if component and not template.has_component(component.name): template.components.append(component) component = None @@ -177,13 +183,11 @@ elif field == 'ParentSuite': template.child = True for nanny in self.templates: + # look for parent and add back ref to it if nanny.name == value: + template.parent = nanny nanny.children.append(template) - # reuse some properties of the parent template - if template.match_uri == None: - template.match_uri = nanny.match_uri - if template.mirror_set == {}: - template.mirror_set = nanny.mirror_set + break elif field == 'Available': template.available = value elif field == 'RepositoryType': @@ -228,6 +232,11 @@ elif field == 'CompDescriptionLong': component.set_description_long(_(value)) if template: + # reuse some properties of the parent template + if template.match_uri == None and template.child: + template.match_uri = template.parent.match_uri + if template.mirror_set == {} and template.child: + template.mirror_set = template.parent.mirror_set if component: template.components.append(component) component = None