From 2722df4ce2e4cd081e47d36a7c965829bad94f6b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 23 Feb 2006 19:51:34 +0100 Subject: * DistUpgrade/TODO: updated --- DistUpgrade/TODO | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'DistUpgrade') diff --git a/DistUpgrade/TODO b/DistUpgrade/TODO index 9d26eefc..df64b54b 100644 --- a/DistUpgrade/TODO +++ b/DistUpgrade/TODO @@ -5,6 +5,11 @@ hoary->breezy (it will crash otherwise) - send a "\n" on the libc6 question on hoary->breezy +breezy->dapper +-------------- +- gnome-icon-theme changes a lot, icons move from hicolor to gnome. + this might have caused a specatular crash during a upgrade + general ------- - CDROM upgrades !!! @@ -42,4 +47,4 @@ Robustness: as possible. The problem here is that e.g. if libnoitfy0 explodes and evolution, update-notifer depend on it, continuing means to evo and u-n can't be upgraded and dpkg explodes on them too. This is not more worse - than what we have right now I guess. \ No newline at end of file + than what we have right now I guess. -- cgit v1.2.3 From 9f1f9070d249457871a92d52eb3817c73e6fe0ac Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sat, 25 Feb 2006 20:10:28 +0100 Subject: * Use nice grammer #32864 * Show a warning about the time an upgrade can take * Show a warning that the upgrade cannot be canceled * Show a warning to close all apps and documents before upgrading * Only show the download size if there are upgrades --- DistUpgrade/DistUpgrade.glade | 3 ++- DistUpgrade/DistUpgradeViewGtk.py | 35 ++++++++++++++++++++++++----------- UpdateManager/UpdateManager.py | 2 +- 3 files changed, 27 insertions(+), 13 deletions(-) (limited to 'DistUpgrade') diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade index c28b20ad..e50476e2 100644 --- a/DistUpgrade/DistUpgrade.glade +++ b/DistUpgrade/DistUpgrade.glade @@ -586,12 +586,13 @@ True + True False True GTK_JUSTIFY_LEFT True - False + True 0 0.5 0 diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 3697a49e..7298b31e 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -126,6 +126,7 @@ class GtkInstallProgressAdapter(InstallProgress): reaper.connect("child-exited", self.child_exited) # some options for dpkg to make it die less easily apt_pkg.Config.Set("DPkg::Options::","--force-overwrite") + def startUpdate(self): self.finished = False # FIXME: add support for the timeout @@ -161,15 +162,19 @@ class GtkInstallProgressAdapter(InstallProgress): def fork(self): pid = self.term.forkpty(envv=self.env) return pid + def child_exited(self, term, pid, status): self.apt_status = os.WEXITSTATUS(status) self.finished = True + def waitChild(self): while not self.finished: self.updateInterface() return self.apt_status + def finishUpdate(self): self.label_status.set_text("") + def updateInterface(self): InstallProgress.updateInterface(self) self.progress.set_fraction(self.percent/100.0) @@ -181,9 +186,6 @@ class GtkInstallProgressAdapter(InstallProgress): class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): " gtk frontend of the distUpgrade tool " - - - def __init__(self): # FIXME: i18n must be somewhere relative do this dir bindtextdomain("update-manager",os.path.join(os.getcwd(),"mo")) @@ -237,6 +239,7 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): self._terminal_lines = [] self._terminal_log = open("/var/log/dist-upgrade-term.log","w") return self._term + def _term_content_changed(self, term): " called when the *visible* part of the terminal changes " @@ -277,7 +280,6 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): attrlist.insert(attr) label.set_property("attributes",attrlist) - def error(self, summary, msg, extended_msg=None): self.dialog_error.set_transient_for(self.window_main) #self.expander_terminal.set_expanded(True) @@ -309,30 +311,41 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): pkgs_remove, "%s packages are going to be removed." %\ pkgs_remove, pkgs_remove) - msg +=" " + msg += " " if pkgs_inst > 0: msg += gettext.ngettext("%s new package is going to be "\ "installed." % pkgs_inst, "%s new packages are going to be "\ "installed." % pkgs_inst, pkgs_inst) - msg +=" " + msg += " " if pkgs_upgrade > 0: msg += gettext.ngettext("%s package is going to be upgraded." %\ pkgs_upgrade, "%s packages are going to be upgraded." %\ pkgs_upgrade, pkgs_upgrade) msg +=" " - if msg == "": + + if downloadSize > 0: + msg += _("You have to download a total of %s." %\ + apt_pkg.SizeToStr(downloadSize)) + + if (pkgs_upgrade + pkgs_inst + pkgs_remove) > 100: + msg += "\n\n%s" % _("The upgrade can take several hours and "\ + "cannot be canceled at any time later.") + + msg += "\n\n%s" % _("To prevent data loss close all open "\ + "applications and documents.") + + # Show an error if no actions are planned + if (pkgs_upgrade + pkgs_inst + pkgs_remove) < 1: # FIXME: this should go into DistUpgradeController summary = _("Could not find any upgrades") msg = _("Your system has already been upgraded.") self.error(summary, msg) return False - else: - msg += _("You have to download a total of %s." %\ - apt_pkg.SizeToStr(downloadSize)) + self.label_summary.set_markup("%s" % summary) - self.label_changes.set_text(msg) + self.label_changes.set_markup(msg) # fill in the details self.details_list.clear() for rm in self.toRemove: diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index e6394223..e6437d3b 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -179,7 +179,7 @@ class UpdateList: #print "WARNING, keeping packages" msg = ("%s\n\n%s" % \ (_("Cannot install all available updates"), - _("Some updates require to remove further software. " + _("Some updates require the removal of further software. " "Use the function \"Smart Upgrade\" of the package manager " "\"Synaptic\" or run \"sudo apt-get dist-upgrade\" in a " "terminal to update your system completely."))) -- cgit v1.2.3 From 48e198078f09e9f561b04897d4554dc262920036 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 27 Feb 2006 14:56:16 +0100 Subject: * TODO updated --- DistUpgrade/TODO | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'DistUpgrade') diff --git a/DistUpgrade/TODO b/DistUpgrade/TODO index df64b54b..04c507be 100644 --- a/DistUpgrade/TODO +++ b/DistUpgrade/TODO @@ -1,24 +1,29 @@ +MUSTFIX: +-------- +* debconf gnome dosn't work (can't connect to the session) +* display a message that all applications should be closed for the + dist-upgrade (and that strange things like a crashing panel can + happen) + -hoary->breezy -------------- -- stop gnome-volume-manager before the hoary->breezy upgrade - (it will crash otherwise) -- send a "\n" on the libc6 question on hoary->breezy breezy->dapper -------------- - gnome-icon-theme changes a lot, icons move from hicolor to gnome. this might have caused a specatular crash during a upgrade + +hoary->breezy +------------- +- stop gnome-volume-manager before the hoary->breezy upgrade + (it will crash otherwise) +- send a "\n" on the libc6 question on hoary->breezy + general ------- - CDROM upgrades !!! -- display a message that all applications should be closed for the - dist-upgrade (and that strange things like a crashing panel can - happen) - whitelist removal (pattern? e.g. c102 -> c2a etc)? -- logging for the dpkg install run - check authentication and don't upgrade anything that is not authenticated (maybe just comment unauthenticated stuff out?) -- cgit v1.2.3 From 979d4cafb3d30920b95dfaf26e204bda408d4591 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 27 Feb 2006 15:16:55 +0100 Subject: * Typos --- DistUpgrade/DistUpgradeView.py | 6 +++--- SoftwareProperties/SoftwareProperties.py | 2 +- data/SoftwareProperties.glade | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'DistUpgrade') diff --git a/DistUpgrade/DistUpgradeView.py b/DistUpgrade/DistUpgradeView.py index 4c9103ba..8e9a3d3f 100644 --- a/DistUpgrade/DistUpgradeView.py +++ b/DistUpgrade/DistUpgradeView.py @@ -65,9 +65,9 @@ class DistUpgradeView(object): def confirmRestart(self): " generic ask about the restart, can be overriden " summary = _("Reboot required") - msg = _("The upgrade is finished now. " - "A reboot is required to " - "now, do you want to do this " + msg = _("The upgrade is finished and " + "a reboot is required. " + "Do you want to do this " "now?") return self.askYesNoQuestion(summary, msg) def error(self, summary, msg, extended_msg=None): diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index d5070240..99ec292f 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -534,7 +534,7 @@ class SoftwareProperties(SimpleGladeApp): type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK, message_format=None) - dialog.set_markup(_("Error scaning the CD\n\n%s"%msg)) + dialog.set_markup(_("Error scanning the CD\n\n%s"%msg)) res = dialog.run() dialog.destroy() return diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index 9a5edbeb..5e5c2b7a 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -424,7 +424,7 @@ True True - _Download updates in the backgound, but do not install them + _Download updates in the background, but do not install them True GTK_RELIEF_NORMAL True -- cgit v1.2.3 From 4a1c03022c92d3c477c333c1592c888cf216b19d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 27 Feb 2006 18:37:25 +0100 Subject: * UpdateManager/MetaRelease.py, DistUpgradeFetcher: - make the authentication work reliable * DistUpgrade/DistUpgradeViewGtk.py: - exit on fatal uncaught exceptions * SoftwareProperties/SoftwareProperties.py: - fix a indent error when adding gpg keys --- DistUpgrade/DistUpgradeViewGtk.py | 1 + SoftwareProperties/SoftwareProperties.py | 2 +- UpdateManager/DistUpgradeFetcher.py | 48 +++++++++++++++++++++++--------- UpdateManager/MetaRelease.py | 8 ++++-- 4 files changed, 43 insertions(+), 16 deletions(-) (limited to 'DistUpgrade') diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 7298b31e..2f7e3fed 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -230,6 +230,7 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): "files ~/dist-upgrade.log and ~/dist-upgrade-apt.log " "in your report. The upgrade aborts now. "), "\n".join(lines)) + sys.exit(1) def create_terminal(self, arg1,arg2,arg3,arg4): " helper to create a vte terminal " diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 1c6963a0..0e892182 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -486,7 +486,7 @@ class SoftwareProperties(SimpleGladeApp): _("Error importing selected file"), _("The selected file may not be a GPG key file " \ "or it might be corrupt.")) - self.reload_keyslist() + self.reload_keyslist() def remove_key_clicked(self, widget): selection = self.treeview2.get_selection() diff --git a/UpdateManager/DistUpgradeFetcher.py b/UpdateManager/DistUpgradeFetcher.py index 7af32865..676f064b 100644 --- a/UpdateManager/DistUpgradeFetcher.py +++ b/UpdateManager/DistUpgradeFetcher.py @@ -91,7 +91,19 @@ class DistUpgradeFetcher(object): return False return True - def authenticate(self, file, signature, keyring='/etc/apt/trusted.gpg'): + def authenticate(self): + if self.new_dist.upgradeToolSig: + f = self.tmpdir+"/"+os.path.basename(self.new_dist.upgradeTool) + sig = self.tmpdir+"/"+os.path.basename(self.new_dist.upgradeToolSig) + print "authenticate '%s' against '%s' " % (f,sig) + if not self.gpgauthenticate(f, sig): + return False + + # we may return False here by default if we want to make a sig + # mandatory + return True + + def gpgauthenticate(self, file, signature, keyring='/etc/apt/trusted.gpg'): """ authenticated a file against a given signature, if no keyring is given use the apt default keyring """ @@ -101,6 +113,7 @@ class DistUpgradeFetcher(object): proc = gpg.run(['--verify', signature, file], create_fhs=['status','logger','stderr']) gpgres = proc.handles['status'].read() + proc.wait() if "VALIDSIG" in gpgres: return True return False @@ -140,23 +153,32 @@ class DistUpgradeFetcher(object): # now download the tarball with the upgrade script self.tmpdir = tmpdir = tempfile.mkdtemp() os.chdir(tmpdir) + + # turn debugging on here (if required) + #apt_pkg.Config.Set("Debug::Acquire::http","1") + + 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: - progress = GtkProgress.GtkFetchProgress(self.parent, - _("Downloading the upgrade " - "tool"), - _("The upgrade tool will " - "guide you through the " - "upgrade process.")) - fetcher = apt_pkg.GetAcquire(progress) 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): #print "runing: %s" % script - os.execv(script,[]) + os.execv(self.script,[]) def cleanup(self): # cleanup @@ -185,10 +207,10 @@ class DistUpgradeFetcher(object): print "verify failed" self.cleanup() return - #if not self.authenticate(distUpgradeTar, distUpgradeSig): - # print "authenticate failed" - # self.cleanup() - # return + if not self.authenticate(): + print "authenticate failed" + self.cleanup() + return self.runDistUpgrader() diff --git a/UpdateManager/MetaRelease.py b/UpdateManager/MetaRelease.py index cd56970f..fde705bb 100644 --- a/UpdateManager/MetaRelease.py +++ b/UpdateManager/MetaRelease.py @@ -38,12 +38,13 @@ class Dist(object): self.supported = supported self.releaseNotesURI = None self.upgradeTool = None + self.upgradeToolSig = None class MetaRelease(gobject.GObject): # some constants - #METARELEASE_URI = "http://changelogs.ubuntu.com/meta-release" - METARELEASE_URI = "http://people.ubuntu.com/~mvo/dist-upgrader/meta-release-test.save" + METARELEASE_URI = "http://changelogs.ubuntu.com/meta-release" + #METARELEASE_URI = "http://people.ubuntu.com/~mvo/dist-upgrader/meta-release-test2" METARELEASE_FILE = "/var/lib/update-manager/meta-release" __gsignals__ = { @@ -73,6 +74,7 @@ class MetaRelease(gobject.GObject): if res != 0: sys.stderr.write("lsb_release returned exitcode: %i\n" % res) dist = string.strip(p.stdout.readline()) + #dist = "breezy" return dist def check(self): @@ -107,6 +109,8 @@ class MetaRelease(gobject.GObject): dist.releaseNotesURI = index_tag.Section["ReleaseNotes"] if index_tag.Section.has_key("UpgradeTool"): dist.upgradeTool = index_tag.Section["UpgradeTool"] + if index_tag.Section.has_key("UpgradeToolSignature"): + dist.upgradeToolSig = index_tag.Section["UpgradeToolSignature"] dists.append(dist) if name == current_dist_name: current_dist = dist -- cgit v1.2.3