From c7817830a12a7136e8e8c28ae433595c56a004d5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 25 Jul 2008 18:15:20 +0200 Subject: * data/templates/Debian.info.in: - add 'lenny' template info --- data/templates/Debian.info.in | 23 +++++++++++++++++++++++ debian/changelog | 7 +++++++ 2 files changed, 30 insertions(+) diff --git a/data/templates/Debian.info.in b/data/templates/Debian.info.in index b635de19..c3ce7fd7 100644 --- a/data/templates/Debian.info.in +++ b/data/templates/Debian.info.in @@ -1,5 +1,28 @@ _ChangelogURI: http://packages.debian.org/changelogs/pool/%s/%s/%s/%s_%s/changelog +Suite: lenny +RepositoryType: deb +BaseURI: http://http.us.debian.org/debian/ +MatchURI: ftp[0-9]*\.[a-z]\.debian\.org +MirrorsFile: /usr/share/python-apt/templates/Debian.mirrors +_Description: Debian 5.0 'Lenny' +Component: main +_CompDescription: Officially supported +Component: contrib +_CompDescription: DFSG-compatible Software with Non-Free Dependencies +Component: non-free +_CompDescription: Non-DFSG-compatible Software + +Suite: lenny-proposed-updates +RepositoryType: deb +ParentSuite: lenny +_Description: Proposed updates + +Suite: lenny/updates +RepositoryType: deb +ParentSuite: lenny +_Description: Security updates + Suite: etch RepositoryType: deb BaseURI: http://http.us.debian.org/debian/ diff --git a/debian/changelog b/debian/changelog index a3792386..49673d48 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +python-apt (0.7.7.1) unstable; urgency=low + + * data/templates/Debian.info.in: + - add 'lenny' template info + + -- Michael Vogt Fri, 25 Jul 2008 18:13:53 +0200 + python-apt (0.7.7) unstable; urgency=low [ Emanuele Rocca ] -- cgit v1.2.3 From 4ea2b04891b17eb22b9321a3896d74a809783915 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 25 Jul 2008 18:33:27 +0200 Subject: * aptsources/distinfo.py: - fix template matching for arch specific code (LP: #244093) --- aptsources/distinfo.py | 45 +++++++++++++++++++++++++++++---------------- debian/changelog | 2 ++ 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index 9b438701..b962def6 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -40,6 +40,7 @@ class Template: def __init__(self): self.name = None self.child = False + self.parents = [] # ref to parent template(s) self.match_name = None self.description = None self.base_uri = None @@ -163,11 +164,8 @@ class DistInfo: elif field == 'MetaReleaseURI': self.metarelease_uri = value elif field == 'Suite': - if template: - if component and not template.has_component(component.name): - template.components.append(component) - component = None - self.templates.append(template) + self.finish_template(template, component) + component=None template = Template() template.name = value template.distribution = dist @@ -177,13 +175,10 @@ class DistInfo: 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.parents.append(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 elif field == 'Available': template.available = value elif field == 'RepositoryType': @@ -227,12 +222,30 @@ class DistInfo: component.set_description(_(value)) elif field == 'CompDescriptionLong': component.set_description_long(_(value)) - if template: - if component: - template.components.append(component) - component = None - self.templates.append(template) - template = None + self.finish_template(template, component) + template=None + component=None + + def finish_template(self, template, component): + " finish the current tempalte " + if not template: + return + # reuse some properties of the parent template + if template.match_uri == None and template.child: + for t in template.parents: + if t.match_uri: + template.match_uri = t.match_uri + break + if template.mirror_set == {} and template.child: + for t in template.parents: + if t.match_uri: + template.mirror_set = t.mirror_set + break + if component and not template.has_component(component.name): + template.components.append(component) + component = None + self.templates.append(template) + if __name__ == "__main__": d = DistInfo ("Ubuntu", "/usr/share/python-apt/templates") diff --git a/debian/changelog b/debian/changelog index 49673d48..c196abe6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ python-apt (0.7.7.1) unstable; urgency=low * data/templates/Debian.info.in: - add 'lenny' template info + * aptsources/distinfo.py: + - fix template matching for arch specific code (LP: #244093) -- Michael Vogt Fri, 25 Jul 2008 18:13:53 +0200 -- cgit v1.2.3 From 4922f32e6ee40511775067241bda6d2dde539c1f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 25 Jul 2008 18:53:56 +0200 Subject: close the right bug for the missing lenny template --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c196abe6..571e0ae5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ python-apt (0.7.7.1) unstable; urgency=low * data/templates/Debian.info.in: - - add 'lenny' template info + - add 'lenny' template info (closes: #476364) * aptsources/distinfo.py: - fix template matching for arch specific code (LP: #244093) -- cgit v1.2.3