summaryrefslogtreecommitdiff
path: root/python/depcache.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2007-06-11 00:32:48 +0200
committerMichael Vogt <egon@bottom>2007-06-11 00:32:48 +0200
commit3c2d0313a45668770e7cb2993dc092fb4e711bb7 (patch)
treef427cec965fcd27822fae3617478768d4f0f26ea /python/depcache.cc
parenta1dcc6a2e3afe8c649c05273955331b97aa50c41 (diff)
parent2b26361164399ab739e694de6ad98f19055f6562 (diff)
downloadpython-apt-3c2d0313a45668770e7cb2993dc092fb4e711bb7.tar.gz
* build against the new apt
* support for new "aptsources" pythn module (thanks to Sebastian Heinlein) * merged support for translated package descriptions * merged support for automatic removal of unused dependencies * merged http://glatzor.de/bzr/python-apt/sebi: - this means that the new aptsources modules is available * support translated pacakge descriptions * support automatic dependency information * python/depcache.cc: - "IsGarbage()" method added (to support auto-mark)
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 71e6a2e6..94ff708c 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -386,6 +386,20 @@ static PyObject *PkgDepCacheIsGarbage(PyObject *Self,PyObject *Args)
return HandleErrors(Py_BuildValue("b",state.Garbage));
}
+static PyObject *PkgDepCacheIsAutoInstalled(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.Flags & pkgCache::Flag::Auto));
+}
+
static PyObject *PkgDepCacheIsNowBroken(PyObject *Self,PyObject *Args)
{
pkgDepCache *depcache = GetCpp<pkgDepCache *>(Self);
@@ -524,6 +538,7 @@ static PyMethodDef PkgDepCacheMethods[] =
{"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)"},
+ {"IsAutoInstalled",PkgDepCacheIsAutoInstalled,METH_VARARGS,"Is pkg marked as auto installed"},
{"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"},