summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-09-18 18:42:20 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-09-18 18:42:20 +0200
commita9dd5cc00d723bedc06a0d17c7ede97fb66c14fd (patch)
tree6739b10caae2a5fd1bba2d40231cb5dfcb42db53
parent283dade78ce3cb31d09dcbc3407b83eedb6d59e4 (diff)
parent8df7cb6c729a5451f231f2cd3e82fc495eaea289 (diff)
downloadpython-apt-a9dd5cc00d723bedc06a0d17c7ede97fb66c14fd.tar.gz
* merged from python-apt--main
-rw-r--r--apt/progress.py18
-rw-r--r--debian/changelog16
-rw-r--r--doc/examples/inst.py5
-rw-r--r--python/apt_pkgmodule.cc2
-rw-r--r--python/pkgmanager.cc2
5 files changed, 32 insertions, 11 deletions
diff --git a/apt/progress.py b/apt/progress.py
index 4119067c..8ac0e1dc 100644
--- a/apt/progress.py
+++ b/apt/progress.py
@@ -19,7 +19,14 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
-import sys, apt_pkg, os, fcntl, string, re
+import sys
+import os
+import re
+import fcntl
+import string
+from errno import *
+import select
+import apt_pkg
class OpProgress(object):
""" Abstract class to implement reporting on cache opening
@@ -139,6 +146,7 @@ class InstallProgress(DumbInstallProgress):
"""
def __init__(self):
DumbInstallProgress.__init__(self)
+ self.selectTimeout = 0.1
(read, write) = os.pipe()
self.writefd=write
self.statusfd = os.fdopen(read, "r")
@@ -162,7 +170,7 @@ class InstallProgress(DumbInstallProgress):
self.read += os.read(self.statusfd.fileno(),1)
except OSError, (errno,errstr):
# resource temporarly unavailable is ignored
- if errno != 11:
+ if errno != EAGAIN and errnor != EWOULDBLOCK:
print errstr
if self.read.endswith("\n"):
s = self.read
@@ -184,22 +192,22 @@ class InstallProgress(DumbInstallProgress):
self.percent = float(percent)
self.status = string.strip(status_str)
self.read = ""
-
def fork(self):
return os.fork()
def waitChild(self):
while True:
+ select.select([self.statusfd],[],[], self.selectTimeout)
+ self.updateInterface()
(pid, res) = os.waitpid(self.child_pid,os.WNOHANG)
if pid == self.child_pid:
break
- self.updateInterface()
return os.WEXITSTATUS(res)
def run(self, pm):
pid = self.fork()
if pid == 0:
# child
res = pm.DoInstall(self.writefd)
- sys.exit(res)
+ os._exit(res)
self.child_pid = pid
res = self.waitChild()
return res
diff --git a/debian/changelog b/debian/changelog
index 603c06b7..964128c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,19 @@
+python-apt (0.6.19ubuntu4) edgy; urgency=low
+
+ * python/pkgmanager.cc:
+ - fix typo (closes: #382853)
+ * debian/control:
+ - tightend dependency (closes: #383478)
+ * apt/progress.py:
+ - use os._exit() in the child (lp: #53298)
+ - use select() when checking for statusfd (lp: #53282)
+ * acknoledge NMU (closes: #378048, #373512)
+ * python/apt_pkgmodule.cc:
+ - fix missing docstring (closes: #368907),
+ Thanks to Josh Triplett
+
+ -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 18 Sep 2006 18:28:19 +0200
+
python-apt (0.6.19ubuntu3) edgy; urgency=low
* merged ddtp support
diff --git a/doc/examples/inst.py b/doc/examples/inst.py
index 0e91c28f..ff9d452c 100644
--- a/doc/examples/inst.py
+++ b/doc/examples/inst.py
@@ -29,10 +29,7 @@ cache = apt.Cache(apt.progress.OpTextProgress())
fprogress = apt.progress.TextFetchProgress()
iprogress = TextInstallProgress()
-pkg = cache["test-package"]
-pkg.markUpgrade()
-cache.commit(fprogress,iprogress)
-sys.exit(1)
+pkg = cache["3dchess"]
# install or remove, the importend thing is to keep us busy :)
if pkg.isInstalled:
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc
index b1c5c2a5..24d876af 100644
--- a/python/apt_pkgmodule.cc
+++ b/python/apt_pkgmodule.cc
@@ -440,7 +440,7 @@ static PyMethodDef methods[] =
{"GetPkgAcqFile",(PyCFunction)GetPkgAcqFile,METH_KEYWORDS|METH_VARARGS,"GetPkgAcquireFile() -> pkgAcquireFile"},
// PkgManager
- {"GetPackageManager",GetPkgManager,METH_VARARGS,"GetPackageManager() -> PackageManager"},
+ {"GetPackageManager",GetPkgManager,METH_VARARGS,"GetPackageManager(DepCache) -> PackageManager"},
{}
};
diff --git a/python/pkgmanager.cc b/python/pkgmanager.cc
index bcd4c45b..9670f238 100644
--- a/python/pkgmanager.cc
+++ b/python/pkgmanager.cc
@@ -68,7 +68,7 @@ static PyObject *PkgManagerFixMissing(PyObject *Self,PyObject *Args)
static PyMethodDef PkgManagerMethods[] =
{
- {"GetArchives",PkgManagerGetArchives,METH_VARARGS,"Load the selected archvies into the fetcher"},
+ {"GetArchives",PkgManagerGetArchives,METH_VARARGS,"Load the selected archives into the fetcher"},
{"DoInstall",PkgManagerDoInstall,METH_VARARGS,"Do the actual install"},
{"FixMissing",PkgManagerFixMissing,METH_VARARGS,"Fix the install if a pkg couldn't be downloaded"},
{}