diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2008-05-28 12:21:28 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2008-05-28 12:21:28 +0200 |
| commit | 32859490d228ab2bc234c48ad27fb0d727dbb108 (patch) | |
| tree | 9b842e2e26fb356b342721a5996d68ad308c83e7 /aptsources | |
| parent | d92a8e975e83e24c2aa2609bbb76d2347ce6ee03 (diff) | |
| parent | 35d1d39728f6e2ef5e025b2359ee6d53911f9cc1 (diff) | |
| download | python-apt-32859490d228ab2bc234c48ad27fb0d727dbb108.tar.gz | |
* aptsources/distinfo.py:
- support arch specific BaseURI, MatchURI and MirrosFile fields
in the distinfo template (LP: #220890)
Diffstat (limited to 'aptsources')
| -rw-r--r-- | aptsources/distinfo.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index fdd063a5..9b438701 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -28,6 +28,7 @@ import gettext from os import getenv import ConfigParser import string +import apt_pkg #from gettext import gettext as _ import gettext @@ -126,6 +127,8 @@ class DistInfo: base_dir = "/usr/share/python-apt/templates"): self.metarelease_uri = '' self.templates = [] + apt_pkg.init() + self.arch = apt_pkg.Config.Find("APT::Architecture") location = None match_loc = re.compile(r"^#LOC:(.+)$") @@ -185,12 +188,16 @@ class DistInfo: template.available = value elif field == 'RepositoryType': template.type = value - elif field == 'BaseURI': + elif field == 'BaseURI' and not template.base_uri: template.base_uri = value + elif field == 'BaseURI-%s' % self.arch: + template.base_uri = value + elif field == 'MatchURI' and not template.match_uri: template.match_uri = value - elif field == 'MatchURI': + elif field == 'MatchURI-%s' % self.arch: template.match_uri = value - elif field == 'MirrorsFile': + elif (field == 'MirrorsFile' or + field == 'MirrorsFile-%s' % self.arch): if not map_mirror_sets.has_key(value): mirror_set = {} try: |
