summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <egon@top>2005-12-05 15:30:48 +0100
committerMichael Vogt <egon@top>2005-12-05 15:30:48 +0100
commita2fe2a40f43d5c95cb849f8f0306ed25dcde2298 (patch)
tree9f67ef6c02e6907b8889d765f9105810cc3085ba
parentbf17713ea0b6bff421d305e8ae91cbb68f46ff8a (diff)
downloadpython-apt-a2fe2a40f43d5c95cb849f8f0306ed25dcde2298.tar.gz
* detect security.u.c as well
-rw-r--r--DistUpgrade/DistUpgrade.py34
-rw-r--r--SoftwareProperties/aptsources.py5
2 files changed, 24 insertions, 15 deletions
diff --git a/DistUpgrade/DistUpgrade.py b/DistUpgrade/DistUpgrade.py
index 3241699a..6ad28388 100644
--- a/DistUpgrade/DistUpgrade.py
+++ b/DistUpgrade/DistUpgrade.py
@@ -54,25 +54,39 @@ class DistUpgradeControler(object):
sources = SourcesList()
sources.backup()
+ # this must map, i.e. second in "from" must be the second in "to"
+ # (but they can be different, so in theory we could exchange
+ # component names here)
fromDists = [fromDist,
fromDist+"-security",
fromDist+"-updates",
fromDist+"-backports"
]
+ toDists = [to,
+ to+"-security",
+ to+"-updates",
+ to+"-backports"
+ ]
+
+ # list of valid mirrors that we can add
+ valid_mirrors = ["http://archive.ubuntu.com/ubuntu",
+ "http://security.ubuntu.com/ubuntu"]
for entry in sources:
# check if it's a mirror (or offical site)
- if sources.is_mirror("http://archive.ubuntu.com/ubuntu",entry.uri):
- if entry.dist in fromDists:
- entry.dist = to
+ for mirror in valid_mirrors:
+ if sources.is_mirror(mirror,entry.uri):
+ if entry.dist in fromDists:
+ entry.dist = toDists[fromDists.index(entry.dist)]
+ else:
+ # disable all entries that are official but don't
+ # point to the "from" dist
+ entry.disabled = True
else:
- # disable all entries that are official but don't
- # point to the "from" dist
- entry.disabled = True
- else:
- # disable non-official entries that point to dist
- if entry.dist == fromDist:
- entry.disabled = True
+ # disable non-official entries that point to dist
+ if entry.dist == fromDist:
+ entry.disabled = True
+ # write!
sources.save()
def breezyUpgrade(self):
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index 1c8273f2..b32b222e 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -131,11 +131,6 @@ class SourceEntry:
# disabled, add a "#"
if string.strip(self.line)[0] != "#":
self.line = "#" + self.line
- def get_disabled(self):
- return not self.disabled
- def set_disabled(self, new_value):
- return self.set_enbaled(not new_value)
- disabled = property(get_disabled, set_disabled)
def str(self):
""" return the current line as string """