diff options
| author | egon <egon@debian-vm> | 2008-06-18 14:47:09 +0200 |
|---|---|---|
| committer | egon <egon@debian-vm> | 2008-06-18 14:47:09 +0200 |
| commit | df08cc2180c01039428effeead8a004552d5dd36 (patch) | |
| tree | 8f7371bbdbb2e29a11c14c9b06bd574dc7a5a176 /aptsources | |
| parent | 44faadf294230dc6384b309b06089520d562f199 (diff) | |
| parent | 58322f187bef63ef6c6768cb055401401623b64a (diff) | |
| download | python-apt-df08cc2180c01039428effeead8a004552d5dd36.tar.gz | |
merged from mvo branch
Diffstat (limited to 'aptsources')
| -rw-r--r-- | aptsources/distinfo.py | 13 | ||||
| -rw-r--r-- | aptsources/distro.py | 2 |
2 files changed, 11 insertions, 4 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: diff --git a/aptsources/distro.py b/aptsources/distro.py index debbb12a..6d3b453f 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -167,7 +167,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: |
