summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-08-29 15:54:13 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-08-29 15:54:13 +0200
commit5bd42f18d1fe7cfca35dabdf22a2a14f11a3b353 (patch)
treea3223379494681b8d7f8ce05efde420aa5e7cf50 /DistUpgrade
parentfa7c32ce8c1419e29397d8b5e642b17f7a9b28f2 (diff)
downloadpython-apt-5bd42f18d1fe7cfca35dabdf22a2a14f11a3b353.tar.gz
* DistUpgrade/DistUpgradeControler.py:
- if run in CDROM mode and the cd fails to mount, fail * UpdateManager/Common/aptsources.py: - from DistInfo import DistInfo (relative now instead of absolute)
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgradeControler.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 5e5902c6..fce38b13 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -65,7 +65,16 @@ class AptCdrom(object):
cdrom = apt_pkg.GetCdrom()
# FIXME: add cdrom progress here for the view
progress = apt.progress.CdromProgress()
- res = cdrom.Add(progress)
+ try:
+ res = cdrom.Add(progress)
+ except SystemError, e:
+ logging.error("can't add cdrom: %s" % e)
+ self.view.error(_("Failed to add the CD"),
+ _("There was a error adding the CD, the "
+ "upgrade will abort. Please report this as "
+ "a bugIf this is a valid Ubuntu CD.\n\n"
+ "The error message was:\n'%s'" % e))
+ return False
logging.debug("AptCdrom.add() returned: %s" % res)
return res
@@ -524,8 +533,9 @@ class DistUpgradeControler(object):
self.abort(1)
# add cdrom (if we have one)
- if self.aptcdrom:
- self.aptcdrom.add(self.sources_backup_ext)
+ if (self.aptcdrom and
+ not self.aptcdrom.add(self.sources_backup_ext)):
+ sys.exit(1)
# run a "apt-get update" now
if not self.doUpdate():