diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-10-21 09:13:58 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-10-21 09:13:58 +0200 |
| commit | 8ca5779cfe930f8a423969f7266949ab2826cede (patch) | |
| tree | 44918730b1f9f5a567ac89f15ab661ae7be1e1a9 /aptsources/sourceslist.py | |
| parent | 50756e0efb5081d3379fa874ca41ab57bdf2798d (diff) | |
| parent | 52097d7edaa97379a4a604be4feb24e5e9c3bd73 (diff) | |
| download | python-apt-8ca5779cfe930f8a423969f7266949ab2826cede.tar.gz | |
merged from the debian-sid branch
Diffstat (limited to 'aptsources/sourceslist.py')
| -rw-r--r-- | aptsources/sourceslist.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py index 353cce2d..40a0379b 100644 --- a/aptsources/sourceslist.py +++ b/aptsources/sourceslist.py @@ -25,6 +25,7 @@ import gettext import glob +import logging import os.path import re import shutil @@ -32,7 +33,7 @@ import sys import time import apt_pkg -from aptsources.distinfo import DistInfo +from distinfo import DistInfo from apt.deprecation import function_deprecated_by @@ -373,7 +374,7 @@ class SourcesList(object): source = SourceEntry(line, file) self.list.append(source) except: - print "could not open file '%s'" % file + logging.warn("could not open file '%s'\n" % file) def save(self): """ save the current sources """ @@ -449,7 +450,10 @@ class SourceEntryMatcher(object): found = False for template in self.templates: if (re.search(template.match_uri, source.uri) and - re.match(template.match_name, source.dist)): + re.match(template.match_name, source.dist) and + # deb is a valid fallback for deb-src (if that is not + # definied, see #760035 + (source.type == template.type or template.type == "deb")): found = True source.template = template break @@ -467,14 +471,14 @@ if __name__ == "__main__": sources = SourcesList() for entry in sources: - print entry.str() + logging.info("entry %s" % entry.str()) #print entry.uri mirror = is_mirror("http://archive.ubuntu.com/ubuntu/", "http://de.archive.ubuntu.com/ubuntu/") - print "is_mirror(): %s" % mirror + logging.info("is_mirror(): %s" % mirror) - 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") + logging.info(is_mirror("http://archive.ubuntu.com/ubuntu", + "http://de.archive.ubuntu.com/ubuntu/")) + logging.info(is_mirror("http://archive.ubuntu.com/ubuntu/", + "http://de.archive.ubuntu.com/ubuntu")) |
