diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-13 10:41:41 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-13 10:41:41 +0200 |
| commit | 0a77702288c82b8b212f1b140a48a7fb22cfca9c (patch) | |
| tree | 0528539192ca792d149dd4511c370741819a30cb /aptsources | |
| parent | 26d9cf8509128791461ca1a8c9b7ef1c28635290 (diff) | |
| download | python-apt-0a77702288c82b8b212f1b140a48a7fb22cfca9c.tar.gz | |
* data/templates/Ubuntu.info.in:
- add extras.ubuntu.com and archvie.canonical.com to the
templates
* aptsources/distinfo.py, aptsources/distro.py:
- support non-official templates (like extras.ubuntu.com)
Diffstat (limited to 'aptsources')
| -rw-r--r-- | aptsources/distinfo.py | 8 | ||||
| -rw-r--r-- | aptsources/distro.py | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index 19308348..6374f185 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -52,6 +52,7 @@ class Template(object): self.mirror_set = {} self.distribution = None self.available = True + self.official = True def has_component(self, comp): ''' Check if the distribution provides the given component ''' @@ -207,7 +208,9 @@ class DistInfo(object): template.parents.append(nanny) nanny.children.append(template) elif field == 'Available': - template.available = value + template.available = apt_pkg.string_to_bool(value) + elif field == 'Official': + template.official = apt_pkg.string_to_bool(value) elif field == 'RepositoryType': template.type = value elif field == 'BaseURI' and not template.base_uri: @@ -275,6 +278,9 @@ class DistInfo(object): if component and not template.has_component(component.name): template.components.append(component) component = None + # the official attribute is inherited + for t in template.parents: + template.official = t.official self.templates.append(template) diff --git a/aptsources/distro.py b/aptsources/distro.py index e51fbe9f..23192f50 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -100,6 +100,7 @@ class Distribution(object): if (source.invalid == False and self.is_codename(source.dist) and source.template and + source.template.official == True and self.is_codename(source.template.name)): #print "yeah! found a distro repo: %s" % source.line # cdroms need do be handled differently |
