diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-05-26 18:32:01 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-05-26 18:32:01 +0200 |
| commit | 726df05e62500b4783151dc07ca2c66f340a1ce4 (patch) | |
| tree | 1681a7e3eaf27a7bf7059d5579540995a453eb49 /DistUpgrade | |
| parent | cf3bdddf97ef146927ffd2dc378a30c58ff66031 (diff) | |
| download | python-apt-726df05e62500b4783151dc07ca2c66f340a1ce4.tar.gz | |
* check if libgnome2-perl is installed and if not expand the terminal and use dialog, otherwise use gnome
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/Changelog | 2 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 4 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeView.py | 4 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeViewGtk.py | 13 |
4 files changed, 17 insertions, 6 deletions
diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog index 70e7e452..1f223398 100644 --- a/DistUpgrade/Changelog +++ b/DistUpgrade/Changelog @@ -3,6 +3,8 @@ to restore the old sources.list (nothing was modified yet) Ubuntu: #46712 - fix a bug in the sourcesList rewriting (ubuntu: #46245) + - expand the terminal when no libgnome2-perl is installed + because debconf might want to ask questions (ubuntu: #46214) 2006-05-12: - space checking improved (ubuntu: #43948) - show software that was demoted from main -> universe diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 44185116..0499d37b 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -313,7 +313,7 @@ class DistUpgradeControler(object): def doDistUpgrade(self): currentRetry = 0 fprogress = self._view.getFetchProgress() - iprogress = self._view.getInstallProgress() + iprogress = self._view.getInstallProgress(self.cache) # retry the fetching in case of errors maxRetries = int(self.config.get("Network","MaxRetries")) while currentRetry < maxRetries: @@ -406,7 +406,7 @@ class DistUpgradeControler(object): if len(changes) > 0 and \ self._view.confirmChanges(summary, changes, 0, actions): fprogress = self._view.getFetchProgress() - iprogress = self._view.getInstallProgress() + iprogress = self._view.getInstallProgress(self.cache) try: res = self.cache.commit(fprogress,iprogress) except (SystemError, IOError), e: diff --git a/DistUpgrade/DistUpgradeView.py b/DistUpgrade/DistUpgradeView.py index faa581c8..4b24ee7f 100644 --- a/DistUpgrade/DistUpgradeView.py +++ b/DistUpgrade/DistUpgradeView.py @@ -35,9 +35,9 @@ class DistUpgradeView(object): def getFetchProgress(self): " return a fetch progress object " return apt.progress.FetchProgress() - def getInstallProgress(self): + def getInstallProgress(self, cache=None): " return a install progress object " - return apt.progress.InstallProgress() + return apt.progress.InstallProgress(cache) def getTerminal(self): return DumbTerminal() def updateStatus(self, msg): diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index b642143f..e94198bc 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -136,6 +136,7 @@ class GtkInstallProgressAdapter(InstallProgress): def __init__(self,parent): InstallProgress.__init__(self) + self._cache = None self.label_status = parent.label_status self.progress = parent.progressbar_cache self.expander = parent.expander_terminal @@ -157,8 +158,15 @@ class GtkInstallProgressAdapter(InstallProgress): self.progress.set_text(" ") self.expander.set_sensitive(True) self.term.show() + # if no libgnome2-perl is installed show the terminal + frontend="gnome" + if self._cache: + if not self._cache.has_key("libgnome2-perl") or \ + not self._cache["libgnome2-perl"].isInstalled: + frontend = "dialog" + self.expander.set_expanded(True) self.env = ["VTE_PTY_KEEP_FD=%s"% self.writefd, - "DEBIAN_FRONTEND=gnome", + "DEBIAN_FRONTEND=%s" % frontend, "APT_LISTCHANGES_FRONTEND=none"] # do a bit of time-keeping self.start_time = 0.0 @@ -368,7 +376,8 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): self._terminal_lines = new_lines def getFetchProgress(self): return self._fetchProgress - def getInstallProgress(self): + def getInstallProgress(self, cache): + self._installProgress._cache = cache return self._installProgress def getOpCacheProgress(self): return self._opCacheProgress |
