diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-09-10 12:02:11 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-09-10 12:02:11 +0200 |
| commit | a021109da0fb1e138adc912c44632f0956243769 (patch) | |
| tree | 0a066ad2e84e7423932a41f9c9e4df7c10719d2d /UpdateManager/Common/aptsources.py | |
| parent | 522d72a3abeacee8b6070481738f9c9edd0a6161 (diff) | |
| download | python-apt-a021109da0fb1e138adc912c44632f0956243769.tar.gz | |
* added new "MirrorsFile" keyword for the DistInfo Tagfile
* look for mirros as well when matching distros
Diffstat (limited to 'UpdateManager/Common/aptsources.py')
| -rw-r--r-- | UpdateManager/Common/aptsources.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/UpdateManager/Common/aptsources.py b/UpdateManager/Common/aptsources.py index 36a9811d..bc6886d9 100644 --- a/UpdateManager/Common/aptsources.py +++ b/UpdateManager/Common/aptsources.py @@ -87,7 +87,8 @@ class SourceEntry: file = apt_pkg.Config.FindDir("Dir::Etc")+apt_pkg.Config.Find("Dir::Etc::sourcelist") self.file = file # the file that the entry is located in self.parse(line) - self.template = None + # FIXME: this name is really misleading and already overloaded + self.template = None # type DistInfo.Suite self.children = [] def __eq__(self, other): @@ -457,12 +458,17 @@ class SourceEntryMatcher: _ = gettext.gettext found = False for template in self.templates: - #print "'%s'" %source.uri - if re.search(template.match_uri, source.uri) and \ - re.match(template.match_name, source.dist): + if (re.search(template.match_uri, source.uri) and + re.match(template.match_name, source.dist)): found = True source.template = template break + for mirror in template.valid_mirrors: + if (is_mirror(mirror,source.uri) and + re.match(template.match_name, source.dist)): + found = True + source.template = template + break return found class Distribution: @@ -717,3 +723,6 @@ if __name__ == "__main__": print is_mirror("http://archive.ubuntu.com/ubuntu", "http://de.archive.ubuntu.com/ubuntu/") + print is_mirror("http://archive.ubuntu.com/ubuntu/", + "http://de.archive.ubuntu.com/ubuntu") + |
