diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-06-26 10:11:25 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-06-26 10:11:25 +0200 |
| commit | 6fc084d34105f336fdf090e2dd45e402e25cfc57 (patch) | |
| tree | 5321c9aa207b8743c7cca63e2b7b05609fbcddf7 /python/depcache.cc | |
| parent | 76fb1f457228cc5efa5f45a7a875ec5bc0e17b3a (diff) | |
| download | python-apt-6fc084d34105f336fdf090e2dd45e402e25cfc57.tar.gz | |
* python/depcache.cc:
- added "DepCache.IsGarbage" flag
Diffstat (limited to 'python/depcache.cc')
| -rw-r--r-- | python/depcache.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/python/depcache.cc b/python/depcache.cc index e8140e2b..60bbc1a4 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -370,6 +370,20 @@ static PyObject *PkgDepCacheIsUpgradable(PyObject *Self,PyObject *Args) return HandleErrors(Py_BuildValue("b",state.Upgradable())); } +static PyObject *PkgDepCacheIsGarbage(PyObject *Self,PyObject *Args) +{ + pkgDepCache *depcache = GetCpp<pkgDepCache *>(Self); + + PyObject *PackageObj; + if (PyArg_ParseTuple(Args,"O!",&PackageType,&PackageObj) == 0) + return 0; + + pkgCache::PkgIterator &Pkg = GetCpp<pkgCache::PkgIterator>(PackageObj); + pkgDepCache::StateCache &state = (*depcache)[Pkg]; + + return HandleErrors(Py_BuildValue("b",state.Garbage)); +} + static PyObject *PkgDepCacheIsNowBroken(PyObject *Self,PyObject *Args) { pkgDepCache *depcache = GetCpp<pkgDepCache *>(Self); @@ -507,6 +521,7 @@ static PyMethodDef PkgDepCacheMethods[] = {"IsUpgradable",PkgDepCacheIsUpgradable,METH_VARARGS,"Is pkg upgradable"}, {"IsNowBroken",PkgDepCacheIsNowBroken,METH_VARARGS,"Is pkg is now broken"}, {"IsInstBroken",PkgDepCacheIsInstBroken,METH_VARARGS,"Is pkg broken on the current install"}, + {"IsGarbage",PkgDepCacheIsGarbage,METH_VARARGS,"Is pkg garbage (mark-n-sweep)"}, {"MarkedInstall",PkgDepCacheMarkedInstall,METH_VARARGS,"Is pkg marked for install"}, {"MarkedUpgrade",PkgDepCacheMarkedUpgrade,METH_VARARGS,"Is pkg marked for upgrade"}, {"MarkedDelete",PkgDepCacheMarkedDelete,METH_VARARGS,"Is pkg marked for delete"}, |
