diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-04-25 19:10:07 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-04-25 19:10:07 +0200 |
| commit | 6e64cd518909238ee6bb9c992c6dfd8e173fec47 (patch) | |
| tree | 1156e332320afa7f3027832c70cca0c8d0fd638d /DistUpgrade | |
| parent | 9532aeb2dbdf40576b352b78d1907af82cd589c1 (diff) | |
| download | python-apt-6e64cd518909238ee6bb9c992c6dfd8e173fec47.tar.gz | |
* DistUpgrade/DistUpgradeViewGtk.py:
- make sure dpkg --configure -a is run when something goes wrong
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/Changelog | 3 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 4 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeViewGtk.py | 14 |
3 files changed, 17 insertions, 4 deletions
diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog index df5bb506..d7885de9 100644 --- a/DistUpgrade/Changelog +++ b/DistUpgrade/Changelog @@ -1,3 +1,6 @@ +2006-04-25: + - make sure that DistUpgradeView.getTerminal().call() actually + waits until the command has finished (dpkg --configure -a) 2006-04-18: - add logging to the sources.list modification code - general logging improvements (thanks to Xavier Poinsard)
\ No newline at end of file diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 9a03f288..ced5d968 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -223,12 +223,12 @@ class DistUpgradeControler(object): res = self.cache.commit(fprogress,iprogress) except SystemError, e: # installing the packages failed, can't be retried + self._view.getTerminal().call(["dpkg","--configure","-a"]) self._view.error(_("Could not install the upgrades"), _("The upgrade aborts now. Your system " "can be in an unusable state. A recovery " - "is now run (dpkg --configure -a)."), + "was run (dpkg --configure -a)."), "%s" % e) - self._view.getTerminal().call(["dpkg","--configure","-a"]) return False except IOError, e: # fetch failed, will be retried 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" |
