progress = GtkProgress.GtkFetchProgress(self.parent, _('Downloading the upgrade tool'), _('The upgrade tool will guide you through the upgrade process.'))
fetcher = apt_pkg.GetAcquire(progress)
if self.new_dist.upgradeToolSig != None:
uri = self.new_dist.upgradeToolSig
af = apt_pkg.GetPkgAcqFile(fetcher, uri, descr = _('Upgrade tool signature'))
if self.new_dist.upgradeTool != None:
self.uri = self.new_dist.upgradeTool
af = apt_pkg.GetPkgAcqFile(fetcher, self.uri, descr = _('Upgrade tool'))
if fetcher.Run() != fetcher.ResultContinue:
return False
return True
return False
def runDistUpgrader(self):
if os.getuid() != 0:
os.execv('/usr/bin/gksu', [
'gksu',
self.script])
else:
os.execv(self.script, [
self.script])
def cleanup(self):
os.chdir('..')
shutil.rmtree(self.tmpdir)
def run(self):
if not self.showReleaseNotes():
return None
if not self.fetchDistUpgrader():
error(self.window_main, _('Failed to fetch'), _('Fetching the upgrade failed. There may be a network problem. '))
return None
if not self.extractDistUpgrader():
error(self.window_main, _('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():
error(self.window_main, _('Verfication failed'), _('Verfing the upgrade failed. There may be a problem with the network or with the server. '))
self.cleanup()
return None
if not self.authenticate():
error(self.window_main, _('Authentication failed'), _('Authenticating the upgrade failed. There may be a problem with the network or with the server. '))