summaryrefslogtreecommitdiff
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
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)
-rw-r--r--DistUpgrade/DistUpgradeControler.py16
-rw-r--r--UpdateManager/Common/aptsources.py4
2 files changed, 15 insertions, 5 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():
diff --git a/UpdateManager/Common/aptsources.py b/UpdateManager/Common/aptsources.py
index 80781cb0..38b1bd92 100644
--- a/UpdateManager/Common/aptsources.py
+++ b/UpdateManager/Common/aptsources.py
@@ -32,8 +32,8 @@ import os.path
#import pdb
-from UpdateManager.Common.DistInfo import DistInfo
-
+#from UpdateManager.Common.DistInfo import DistInfo
+from DistInfo import DistInfo
# some global helpers
def is_mirror(master_uri, compare_uri):