return self.error(_('Could not run the upgrade tool'), _('Could not run the upgrade tool') + '. ' + _('This is most likely a bug in the upgrade tool. Please report it as a bug'))
af = apt_pkg.GetPkgAcqFile(fetcher, self.uri, descr = _('Upgrade tool'))
if fetcher.Run() != fetcher.ResultContinue:
return False
for f in [
os.path.basename(self.new_dist.upgradeToolSig),
os.path.basename(self.new_dist.upgradeTool)]:
if not os.path.exists(f) and os.path.getsize(f) > 0:
return False
return True
return False
def runDistUpgrader(self):
args = [
self.script] + self.run_options
if os.getuid() != 0:
os.execv('/usr/bin/sudo', [
'sudo'] + args)
else:
os.execv(self.script, args)
def cleanup(self):
os.chdir('..')
shutil.rmtree(self.tmpdir)
def run(self):
if not self.showReleaseNotes():
return None
if not self.fetchDistUpgrader():
self.error(_('Failed to fetch'), _('Fetching the upgrade failed. There may be a network problem. '))
return None
if not self.extractDistUpgrader():
self.error(_('Failed to extract'), _('Extracting the upgrade failed. There may be a problem with the network or with the server. '))
return None
if not self.verifyDistUprader():
self.error(_('Verfication failed'), _('Verifying the upgrade failed. There may be a problem with the network or with the server. '))
self.cleanup()
return None
if not self.authenticate():
self.error(_('Authentication failed'), _('Authenticating the upgrade failed. There may be a problem with the network or with the server. '))
self.cleanup()
return None
try:
self.runDistUpgrader()
except OSError:
self.authenticate()
e = self.authenticate()
self.verifyDistUprader()
if e.errno == 13:
self.error(_('Can not run the upgrade'), _('This usually is caused by a system were /tmp is mounted noexec. Please remount without noexec and run the upgrade again.'))
return False
self.error(_('Can not run the upgrade'), _("The error message is '%s'." % e.strerror))