diff options
| author | Ben Finney <ben+debian@benfinney.id.au> | 2008-06-21 01:11:59 +1000 |
|---|---|---|
| committer | Ben Finney <ben+debian@benfinney.id.au> | 2008-06-21 01:11:59 +1000 |
| commit | 535fdf276e94c99ec812aa66cb2a95a29a0c6d48 (patch) | |
| tree | d582c702f4086d7275da3e42645999f93f294b77 /aptsources | |
| parent | f264f62b7602f960bc35f3f68b1ed14c61bbfdd5 (diff) | |
| parent | df08cc2180c01039428effeead8a004552d5dd36 (diff) | |
| download | python-apt-535fdf276e94c99ec812aa66cb2a95a29a0c6d48.tar.gz | |
Merge from python-apt.debian-sid/.
Diffstat (limited to 'aptsources')
| -rw-r--r-- | aptsources/distinfo.py | 14 | ||||
| -rw-r--r-- | aptsources/distro.py | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index 3bdbd653..d7dfd970 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -28,7 +28,7 @@ import gettext from os import getenv import ConfigParser import string -import re +import apt_pkg #from gettext import gettext as _ import gettext @@ -151,6 +151,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:(.+)$") @@ -212,12 +214,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: diff --git a/aptsources/distro.py b/aptsources/distro.py index f631e285..0bf8aba9 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -177,7 +177,7 @@ class Distribution: # try to guess the nearest mirror from the locale self.country = None self.country_code = None - locale = os.getenv("LANG", default="en.UK") + locale = os.getenv("LANG", default="en_UK") a = locale.find("_") z = locale.find(".") if z == -1: |
