diff options
| author | Michael Vogt <egon@bottom> | 2007-11-29 12:25:33 +0100 |
|---|---|---|
| committer | Michael Vogt <egon@bottom> | 2007-11-29 12:25:33 +0100 |
| commit | 0fc4aa9466d57ddc4a54191eeb8775e41ad35525 (patch) | |
| tree | 93b7f4e949c3c013309d397de200d058ec7b5af5 /python/depcache.cc | |
| parent | be3ddb25ea0baa259f20936f1d7a62cafa019b99 (diff) | |
| parent | abf6c5801c6b162a9dcda5099e8eb746525dc826 (diff) | |
| download | python-apt-0fc4aa9466d57ddc4a54191eeb8775e41ad35525.tar.gz | |
* apt/package.py:
- fix apt.package.Dependency.relation initialization
* python/string.cc:
- fix overflow in SizeToStr()
* python/metaindex.cc:
- added support for the metaIndex objects
* python/sourceslist.cc:
- support new "List" attribute that returns the list of
metaIndex source entries
* python/depcache.cc:
- be more threading friendly
* python/tag.cc
- support "None" as default in
ParseSection(control).get(field, default), LP: #44470
* python/progress.cc:
- fix refcount problem in OpProgress
- fix refcount problem in FetchProgress
- fix refcount problem in CdromProgress
* apt/README.apt:
- fix typo (thanks to Thomas Schoepf, closes: #387787)
* po/fr.po:
- merge update, thanks to Christian Perrier (closes: #435918)
Diffstat (limited to 'python/depcache.cc')
| -rw-r--r-- | python/depcache.cc | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/python/depcache.cc b/python/depcache.cc index 94ff708c..f44f2f32 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -227,17 +227,19 @@ static PyObject *PkgDepCacheGetCandidateVer(PyObject *Self,PyObject *Args) static PyObject *PkgDepCacheUpgrade(PyObject *Self,PyObject *Args) { + bool res; pkgDepCache *depcache = GetCpp<pkgDepCache *>(Self); char distUpgrade=0; if (PyArg_ParseTuple(Args,"|b",&distUpgrade) == 0) return 0; - bool res; + Py_BEGIN_ALLOW_THREADS if(distUpgrade) res = pkgDistUpgrade(*depcache); else res = pkgAllUpgrade(*depcache); + Py_END_ALLOW_THREADS Py_INCREF(Py_None); return HandleErrors(Py_BuildValue("b",res)); @@ -245,12 +247,15 @@ static PyObject *PkgDepCacheUpgrade(PyObject *Self,PyObject *Args) static PyObject *PkgDepCacheMinimizeUpgrade(PyObject *Self,PyObject *Args) { + bool res; pkgDepCache *depcache = GetCpp<pkgDepCache *>(Self); if (PyArg_ParseTuple(Args,"") == 0) return 0; - bool res = pkgMinimizeUpgrade(*depcache); + Py_BEGIN_ALLOW_THREADS + res = pkgMinimizeUpgrade(*depcache); + Py_END_ALLOW_THREADS Py_INCREF(Py_None); return HandleErrors(Py_BuildValue("b",res)); @@ -351,8 +356,10 @@ static PyObject *PkgDepCacheMarkInstall(PyObject *Self,PyObject *Args) &autoInst, &fromUser) == 0) return 0; + Py_BEGIN_ALLOW_THREADS pkgCache::PkgIterator &Pkg = GetCpp<pkgCache::PkgIterator>(PackageObj); depcache->MarkInstall(Pkg, autoInst, 0, fromUser); + Py_END_ALLOW_THREADS Py_INCREF(Py_None); return HandleErrors(Py_None); @@ -652,23 +659,31 @@ PyObject *GetPkgProblemResolver(PyObject *Self,PyObject *Args) static PyObject *PkgProblemResolverResolve(PyObject *Self,PyObject *Args) { + bool res; pkgProblemResolver *fixer = GetCpp<pkgProblemResolver *>(Self); char brokenFix=1; if (PyArg_ParseTuple(Args,"|b",&brokenFix) == 0) return 0; - bool res = fixer->Resolve(brokenFix); + Py_BEGIN_ALLOW_THREADS + res = fixer->Resolve(brokenFix); + Py_END_ALLOW_THREADS return HandleErrors(Py_BuildValue("b", res)); } static PyObject *PkgProblemResolverResolveByKeep(PyObject *Self,PyObject *Args) -{ +{ + bool res; pkgProblemResolver *fixer = GetCpp<pkgProblemResolver *>(Self); if (PyArg_ParseTuple(Args,"") == 0) return 0; - bool res = fixer->ResolveByKeep(); + + Py_BEGIN_ALLOW_THREADS + res = fixer->ResolveByKeep(); + Py_END_ALLOW_THREADS + return HandleErrors(Py_BuildValue("b", res)); } |
