diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/makefile | 1 | ||||
| -rw-r--r-- | python/progress.cc | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/python/makefile b/python/makefile index 273096a7..16bfcd88 100644 --- a/python/makefile +++ b/python/makefile @@ -22,3 +22,4 @@ LIB_MAKES = apt-inst/makefile APT_INST_SRC = apt_instmodule.cc tar.cc generic.cc SOURCE := $(APT_INST_SRC) include $(PYTHON_H) + diff --git a/python/progress.cc b/python/progress.cc index f79090f7..fb56ea87 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -11,6 +11,7 @@ #include <sys/wait.h> #include "progress.h" + // generic bool PyCallbackObj::RunSimpleCallback(const char* method_name, PyObject *arglist, @@ -220,7 +221,7 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm) return pkgPackageManager::Failed; } if(!PyArg_Parse(result, "i", &child_id) ) - std::cerr << "result could not be parsed?"<< std::endl; + std::cerr << "custom fork() result could not be parsed?"<< std::endl; //std::cerr << "got: " << child_id << std::endl; } else { //std::cerr << "using build-in fork()" << std::endl; @@ -235,10 +236,14 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm) } #endif if (child_id == 0) { - res = pm->DoInstall(); + PyObject *v = PyObject_GetAttrString(callbackInst, "writefd"); + int fd = PyObject_AsFileDescriptor(v); + cout << "got fd: " << fd << endl; + res = pm->DoInstall(fd); _exit(res); } + StartUpdate(); while (waitpid(child_id, &ret, WNOHANG) == 0) UpdateInterface(); |
