summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-06-26 10:11:25 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-06-26 10:11:25 +0200
commit6fc084d34105f336fdf090e2dd45e402e25cfc57 (patch)
tree5321c9aa207b8743c7cca63e2b7b05609fbcddf7 /python
parent76fb1f457228cc5efa5f45a7a875ec5bc0e17b3a (diff)
downloadpython-apt-6fc084d34105f336fdf090e2dd45e402e25cfc57.tar.gz
* python/depcache.cc:
- added "DepCache.IsGarbage" flag
Diffstat (limited to 'python')
-rw-r--r--python/depcache.cc15
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"},