diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-10-04 16:42:50 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-10-04 16:42:50 +0200 |
| commit | c24de9d51b0d3a5e8953dfc2b59aef85cafd34f1 (patch) | |
| tree | df97cd2d44ef44b7938d29ba3598bee7c637477a /apt | |
| parent | 822ebea49fadca39591a566ad5ef7559d3adc26d (diff) | |
| parent | a2363f7e30c93599af6366413bad965846a12d83 (diff) | |
| download | python-apt-c24de9d51b0d3a5e8953dfc2b59aef85cafd34f1.tar.gz | |
- packages in marked_install state can also be auto-removable
* add concept of "ParentComponent" for e.g. ubuntu/multiverse
that needs universe enabled as well (plus add test)
* apt/progress/gtk2.py:
- update to the latest vte API for child-exited (LP: #865388)
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/package.py | 4 | ||||
| -rw-r--r-- | apt/progress/gtk2.py | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/apt/package.py b/apt/package.py index dbc5b23e..4104f93e 100644 --- a/apt/package.py +++ b/apt/package.py @@ -973,8 +973,8 @@ class Package(object): another package, and if no packages depend on it anymore, the package is no longer required. """ - return self.is_installed and \ - self._pcache._depcache.is_garbage(self._pkg) + return ((self.is_installed or self.marked_install) and + self._pcache._depcache.is_garbage(self._pkg)) @property def is_auto_installed(self): diff --git a/apt/progress/gtk2.py b/apt/progress/gtk2.py index 9137ef76..b5794e92 100644 --- a/apt/progress/gtk2.py +++ b/apt/progress/gtk2.py @@ -34,6 +34,7 @@ except ImportError: import gobject as glib import gobject import pango +import time import vte import apt_pkg @@ -127,16 +128,15 @@ class GInstallProgress(gobject.GObject, base.InstallProgress): self.apt_status = -1 self.time_last_update = time.time() self.term = term - reaper = vte.reaper_get() - reaper.connect("child-exited", self.child_exited) + self.term.connect("child-exited", self.child_exited) self.env = ["VTE_PTY_KEEP_FD=%s" % self.writefd, "DEBIAN_FRONTEND=gnome", "APT_LISTCHANGES_FRONTEND=gtk"] self._context = glib.main_context_default() - def child_exited(self, term, pid, status): + def child_exited(self, term): """Called when a child process exits""" - self.apt_status = os.WEXITSTATUS(status) + self.apt_status = term.get_child_exit_status() self.finished = True def error(self, pkg, errormsg): @@ -204,6 +204,7 @@ class GInstallProgress(gobject.GObject, base.InstallProgress): """Wait for the child process to exit.""" while not self.finished: self.update_interface() + time.sleep(0.02) return self.apt_status if apt_pkg._COMPAT_0_7: |
