From 6e64cd518909238ee6bb9c992c6dfd8e173fec47 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 25 Apr 2006 19:10:07 +0200 Subject: * DistUpgrade/DistUpgradeViewGtk.py: - make sure dpkg --configure -a is run when something goes wrong --- DistUpgrade/DistUpgradeViewGtk.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 3236ba14..bf1fcbe8 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -253,9 +253,19 @@ class DistUpgradeVteTerminal(object): self.term = term self.parent = parent def call(self, cmd): + def wait_for_child(widget): + #print "wait for child finished" + self.finished=True self.term.show() + self.term.connect("child-exited", wait_for_child) self.parent.expander_terminal.set_expanded(True) self.term.fork_command(command=cmd[0],argv=cmd) + self.finished = False + while not self.finished: + while gtk.events_pending(): + gtk.main_iteration() + time.sleep(0.1) + del self.finished class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): " gtk frontend of the distUpgrade tool " @@ -497,10 +507,10 @@ if __name__ == "__main__": cache[pkg].markInstall() cache.commit(fp,ip) - sys.exit(0) + #sys.exit(0) ip.conffile("TODO","TODO~") view.getTerminal().call(["dpkg","--configure","-a"]) - view.getTerminal().call(["ls"]) + view.getTerminal().call(["ls","-R","/usr"]) view.error("short","long", "asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended\n" "asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended\n" -- cgit v1.2.3 From caca5e2d382ef3a0e5d00dc888f0448620372ee0 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 27 Apr 2006 17:57:13 +0200 Subject: * check for BaseMetaPkgs after the cache was reopend (to see if the update still has the essential packages) --- DistUpgrade/DistUpgradeControler.py | 10 +++++----- DistUpgrade/DistUpgradeViewGtk.py | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 15a29c05..65713e68 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -336,6 +336,10 @@ class DistUpgradeControler(object): # then update the package index files if not self.doUpdate(): self.abort() + + # then open the cache (again) + self._view.updateStatus(_("Checking package manager")) + self.openCache() # now check if we still have some key packages after the update # if not something went seriously wrong for pkg in self.config.getlist("Distro","BaseMetaPkgs"): @@ -346,13 +350,9 @@ class DistUpgradeControler(object): "updated the essential package '%s' can " "not be found anymore.\n" "This indicates a serious error, please " - "report this as a bug.")) + "report this as a bug.") % pkg) self.abort() - # then open the cache (again) - self._view.updateStatus(_("Checking package manager")) - self.openCache() - # calc the dist-upgrade and see if the removals are ok/expected # do the dist-upgrade self._view.setStep(3) diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index bf1fcbe8..561ab22c 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -309,8 +309,11 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): logging.error("not handled expection:\n%s" % "\n".join(lines)) self.error(_("A fatal error occured"), _("Please report this as a bug and include the " - "files ~/dist-upgrade.log and ~/dist-upgrade-apt.log " - "in your report. The upgrade aborts now. "), + "files /var/log/dist-upgrade.log and " + "/var/log/dist-upgrade-apt.log " + "in your report. The upgrade aborts now.\n" + "Your original sources.list was saved in " + "/etc/apt/sources.list.distUpgrade."), "\n".join(lines)) sys.exit(1) -- cgit v1.2.3 From 34eb7395b42df46fe9caf53d107d212e39a7cdf8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 28 Apr 2006 17:56:16 +0200 Subject: * DistUpgrade/DistUpgradeView.py: - added information() function * DistUpgrade/DistUpgradeViewGtk.py: - implemented gtk information() function * DistUpgrade/DistUpgradeControler.py: - inform the user about disabled third party sources --- DistUpgrade/DistUpgradeControler.py | 16 ++++++++++++++-- DistUpgrade/DistUpgradeView.py | 4 +++- DistUpgrade/DistUpgradeViewGtk.py | 10 ++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 3cf17c65..c486a407 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -77,6 +77,8 @@ class DistUpgradeControler(object): # list of valid mirrors that we can add valid_mirrors = self.config.getListFromFile("Sources","ValidMirrors") + self.sources_disabled = False + # look over the stuff we have foundToDist = False for entry in self.sources: @@ -105,12 +107,14 @@ class DistUpgradeControler(object): # disable all entries that are official but don't # point to either "to" or "from" dist entry.disabled = True + self.sources_disabled = True logging.debug("entry '%s' was disabled (unknown dist)" % entry) # it can only be one valid mirror, so we can break here break # disable anything that is not from a official mirror if not validMirror: entry.disabled = True + self.sources_disabled = True logging.debug("entry '%s' was disabled (unknown mirror)" % entry) return foundToDist @@ -123,7 +127,7 @@ class DistUpgradeControler(object): _("While scaning your repository " "information no mirror entry for " "the upgrade was found." - "This cam happen if you run a interal " + "This cam happen if you run a internal " "mirror or if the mirror information is " "out of date.\n\n" "Do you want to rewrite your " @@ -140,7 +144,7 @@ class DistUpgradeControler(object): prim = _("Generate default sources?") secon = _("After scanning your 'sources.list' no " "valid entry for '%s' was found.\n\n" - "Should the default entries for '%s' be " + "Should default entries for '%s' be " "added? If you select 'No' the update " "will cancel.") % (self.fromDist, self.toDist) if not self._view.askYesNoQuestion(prim, secon): @@ -175,6 +179,14 @@ class DistUpgradeControler(object): "resulted in a invalid file. Please " "report this as a bug.")) return False + + if self.sources_disabled: + self._view.information(_("Third party sources disabled"), + _("Some third party entries in your souces.list " + "where disabled. You can re-enable them " + "after the upgrade with the " + "'software-properties' tool or with synaptic." + )) return True def _logChanges(self): diff --git a/DistUpgrade/DistUpgradeView.py b/DistUpgrade/DistUpgradeView.py index 57b94636..99dedc6f 100644 --- a/DistUpgrade/DistUpgradeView.py +++ b/DistUpgrade/DistUpgradeView.py @@ -81,4 +81,6 @@ class DistUpgradeView(object): def error(self, summary, msg, extended_msg=None): " display a error " pass - + def information(self, summary, msg): + " display a information msg" + pass diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 561ab22c..69990fd5 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -373,6 +373,16 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): attrlist.insert(attr) label.set_property("attributes",attrlist) + def information(self, summary, msg): + msg = "%s\n\n%s" % (summary,msg) + dialog = gtk.MessageDialog(parent=self.window_main, + flags=gtk.DIALOG_MODAL, + type=gtk.MESSAGE_INFO, + buttons=gtk.BUTTONS_CLOSE) + dialog.set_markup(msg) + dialog.run() + dialog.destroy() + def error(self, summary, msg, extended_msg=None): self.dialog_error.set_transient_for(self.window_main) #self.expander_terminal.set_expanded(True) -- cgit v1.2.3 From 44f04eb81fa2fefaa766baa919cacd5dc90f5641 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 28 Apr 2006 18:08:49 +0200 Subject: * DistUpgrade/Changelog: updated * DistUpgrade/DistUpgradeControler.py: some FIXMEs added * DistUpgrade/DistUpgradeViewGtk.py: - dont report dpkg timeouts (no activity on terinal) over and over again --- DistUpgrade/Changelog | 7 +++++++ DistUpgrade/DistUpgradeControler.py | 8 +++++++- DistUpgrade/DistUpgradeViewGtk.py | 5 ++++- DistUpgrade/TODO | 2 ++ 4 files changed, 20 insertions(+), 2 deletions(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog index 4a69f51f..c450d99d 100644 --- a/DistUpgrade/Changelog +++ b/DistUpgrade/Changelog @@ -1,3 +1,10 @@ +2006-04-28: + - add more sanity checking, if no valid mirror is found in the + sources.list ask for "dumb" rewrite + - if nothing valid was found after a dumb rewrite, add official + sources + - don't report install TIMEOUT over and over in the log + - report what package caused a install TIMEOUT 2006-04-27: - add a additonal sanity check after the rewriting of the sources.list (check for BaseMetaPkgs still in the cache) diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index c486a407..c89f6a34 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -149,7 +149,9 @@ class DistUpgradeControler(object): "will cancel.") % (self.fromDist, self.toDist) if not self._view.askYesNoQuestion(prim, secon): self.abort() - # add some defaults + + # add some defaults here + # FIXME: find mirror here uri = "http://archive.ubuntu.com/ubuntu" comps = ["main","restricted"] self.sources.add("deb", uri, self.toDist, comps) @@ -389,6 +391,10 @@ class DistUpgradeControler(object): # if not something went seriously wrong for pkg in self.config.getlist("Distro","BaseMetaPkgs"): if not self.cache.has_key(pkg): + # FIXME: we could offer to add default source entries here, + # but we need to be careful to not duplicate them + # (i.e. the error here could be something else than + # missing sources entires but network errors etc) logging.error("No '%s' after sources.list rewrite+update") self._view.error(_("Inavlid package information"), _("After your package information was " diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 69990fd5..81cd9bba 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -212,6 +212,7 @@ class GtkInstallProgressAdapter(InstallProgress): # start showing when we gathered some data if percent > 1.0: self.last_activity = time.time() + self.activity_timeout_reported = False delta = self.last_activity - self.start_time time_per_percent = (float(delta)/percent) eta = (100.0 - self.percent) * time_per_percent @@ -242,7 +243,9 @@ class GtkInstallProgressAdapter(InstallProgress): # check about terminal activity if self.last_activity > 0 and \ (self.last_activity + self.TIMEOUT_TERMINAL_ACTIVITY) < time.time(): - logging.warning("no activity on terminal for %s seconds" % self.TIMEOUT_TERMINAL_ACTIVITY) + if not self.activity_timeout_reported: + logging.warning("no activity on terminal for %s seconds (%s)" % (self.TIMEOUT_TERMINAL_ACTIVITY, self.label_status.get_text()) + self.activity_timeout_reported = True self.parent.expander_terminal.set_expanded(True) while gtk.events_pending(): gtk.main_iteration() diff --git a/DistUpgrade/TODO b/DistUpgrade/TODO index c32e6bc3..d3f3ad66 100644 --- a/DistUpgrade/TODO +++ b/DistUpgrade/TODO @@ -11,7 +11,9 @@ MUSTFIX: are commented out (or for sources that can't be identified and rewrite ask the user what to do by just s/breezy/dapper/g?) + [Done] * inform about commented out sources + [Done] * fix "no activity for 120s warning" being repeated every sec in the logs * use the dialog frontend (for debconf) and detect the ansi sequence that clear the screen and expand the terminal then -- cgit v1.2.3 From 979636110ae0ca3364e80f8ef5b767546be3021a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 28 Apr 2006 18:18:06 +0200 Subject: * typo --- DistUpgrade/DistUpgradeViewGtk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 81cd9bba..f3ab2983 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -244,7 +244,7 @@ class GtkInstallProgressAdapter(InstallProgress): if self.last_activity > 0 and \ (self.last_activity + self.TIMEOUT_TERMINAL_ACTIVITY) < time.time(): if not self.activity_timeout_reported: - logging.warning("no activity on terminal for %s seconds (%s)" % (self.TIMEOUT_TERMINAL_ACTIVITY, self.label_status.get_text()) + logging.warning("no activity on terminal for %s seconds (%s)" % (self.TIMEOUT_TERMINAL_ACTIVITY, self.label_status.get_text())) self.activity_timeout_reported = True self.parent.expander_terminal.set_expanded(True) while gtk.events_pending(): -- cgit v1.2.3