summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Heinlein <sebi@sebi-laptop>2006-11-30 21:02:47 +0100
committerSebastian Heinlein <sebi@sebi-laptop>2006-11-30 21:02:47 +0100
commit3238d360ff4101b808f6259414c7b3bd38bd3f93 (patch)
tree252f7b9f68dfd01f81c4de39a5dce3790500346e
parent0bae63862cc7a1460cfa1734bb4217927ec3651a (diff)
downloadpython-apt-3238d360ff4101b808f6259414c7b3bd38bd3f93.tar.gz
* handle testing and unstable as synonyms for the release codename
on Debian (testing == etch)
-rw-r--r--AptSources/aptsources.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/AptSources/aptsources.py b/AptSources/aptsources.py
index 0036641c..884260d5 100644
--- a/AptSources/aptsources.py
+++ b/AptSources/aptsources.py
@@ -461,7 +461,7 @@ class Distribution:
# find the distro template
for template in self.sourceslist.matcher.templates:
- if template.name == self.codename and\
+ if self.is_codename(template.name) and\
template.distribution == self.id:
#print "yeah! found a template for %s" % self.description
#print template.description, template.base_uri, template.components
@@ -480,9 +480,9 @@ class Distribution:
source_code = []
for source in self.sourceslist.list:
if source.invalid == False and\
- source.dist == self.codename and\
+ self.is_codename(source.dist) and\
source.template and\
- source.template.name == self.codename:
+ self.is_codename(source.template.name):
#print "yeah! found a distro repo: %s" % source.line
# cdroms need do be handled differently
if source.uri.startswith("cdrom:") and \
@@ -655,9 +655,23 @@ class Distribution:
if not "security.ubuntu.com" in source.uri:
source.uri = uri
+ def is_codename(self, name):
+ ''' Compare a given name with the release codename. '''
+ if name == self.codename:
+ return True
+ else:
+ return False
+
class DebianDistribution(Distribution):
- ''' Class to support specific Debian features '''
- pass
+ ''' Class to support specific Debian features '''
+
+ def is_codename(self, name):
+ ''' Compare a given name with the release codename and check if
+ if it can be used as a synonym for a development releases '''
+ if name == self.codename or self.release in ("testing", "unstable"):
+ return True
+ else:
+ return False
class UbuntuDistribution(Distribution):
''' Class to support specific Ubuntu features '''