diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2008-07-25 18:35:00 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2008-07-25 18:35:00 +0200 |
| commit | f5cec7ab0596ba15e6451745aa0770a84b151c58 (patch) | |
| tree | 03bfffb628573abca362d11f6d7bf66da0cf85ec | |
| parent | 268c7947aa2311682df06bbc70a7c3f5f20d9c1f (diff) | |
| parent | 4ea2b04891b17eb22b9321a3896d74a809783915 (diff) | |
| download | python-apt-f5cec7ab0596ba15e6451745aa0770a84b151c58.tar.gz | |
* data/templates/Debian.info.in:
- add 'lenny' template info
* aptsources/distinfo.py:
- fix template matching for arch specific code (LP: #244093)
| -rw-r--r-- | aptsources/distinfo.py | 45 | ||||
| -rw-r--r-- | data/templates/Debian.info.in | 23 | ||||
| -rw-r--r-- | debian/changelog | 9 |
3 files changed, 61 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/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 8b622796..c8963fe2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +python-apt (0.7.7ubuntu2) intrepid; 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 <michael.vogt@ubuntu.com> Fri, 25 Jul 2008 18:34:28 +0200 + python-apt (0.7.7ubuntu1) intrepid; urgency=low * merged from debian-sid |
