summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-04-28 17:19:15 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-04-28 17:19:15 +0200
commit17403f483aa261be15fd9620597d18c61da3a80c (patch)
tree9ef98d66cc8e67969a9bc9e4068d5fc3f1ce71d6 /DistUpgrade
parenta9a866526f0f40d2eb88400325b3f5b454568029 (diff)
downloadpython-apt-17403f483aa261be15fd9620597d18c61da3a80c.tar.gz
* DistUpgrade/DistUpgradeControler.py:
- sources.list rewrite code will add some defaults now if nothing was found during the rewrite
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgradeControler.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 4a01671d..3cf17c65 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -80,8 +80,9 @@ class DistUpgradeControler(object):
# look over the stuff we have
foundToDist = False
for entry in self.sources:
- # ignore invalid records (but update disabled ones)
- if entry.invalid:
+ # ignore invalid records (but update disabled ones)
+ # or cdrom entries
+ if entry.invalid or entry.uri.startswith("cdrom:"):
continue
logging.debug("examining: '%s'" % entry)
# check if it's a mirror (or offical site)
@@ -90,7 +91,7 @@ class DistUpgradeControler(object):
if not mirror_check or is_mirror(mirror,entry.uri):
validMirror = True
# security is a special case
- res = not entry.uri.startswith("http://security.ubuntu.com")
+ res = not entry.uri.startswith("http://security.ubuntu.com") and not entry.disabled
if entry.dist in toDists:
# so the self.sources.list is already set to the new
# distro
@@ -134,7 +135,24 @@ class DistUpgradeControler(object):
if res:
# re-init the sources and try again
self.sources = SourcesList()
- self.rewriteSourcesList(mirror_check=False)
+ if not self.rewriteSourcesList(mirror_check=False):
+ #hm, still nothing useful ...
+ prim = _("Generate default sources?")
+ secon = _("After scanning your 'sources.list' no "
+ "valid entry for '%s' was found.\n\n"
+ "Should the default entries for '%s' be "
+ "added? If you select 'No' the update "
+ "will cancel.") % (self.fromDist, self.toDist)
+ if not self._view.askYesNoQuestion(prim, secon):
+ self.abort()
+ # add some defaults
+ uri = "http://archive.ubuntu.com/ubuntu"
+ comps = ["main","restricted"]
+ self.sources.add("deb", uri, self.toDist, comps)
+ self.sources.add("deb", uri, self.toDist+"-updates", comps)
+ self.sources.add("deb",
+ "http://security.ubuntu.com/ubuntu/",
+ self.toDist+"-security", comps)
else:
self.abort()