summaryrefslogtreecommitdiff
path: root/python/depcache.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-07-27 15:01:36 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-07-27 15:01:36 +0200
commitf97acdd802c0eb578cd730119d676fbdfabc4129 (patch)
tree1540769056c163122d85a734d17fa2c07bdd509d /python/depcache.cc
parentaf398fcce8671bc864e4300c1b0bbeb07ab95aaf (diff)
parent6fc084d34105f336fdf090e2dd45e402e25cfc57 (diff)
downloadpython-apt-f97acdd802c0eb578cd730119d676fbdfabc4129.tar.gz
* merged the auto-mark branch
Diffstat (limited to 'python/depcache.cc')
-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"},