diff options
| author | Michael Vogt <egon@tas> | 2007-03-14 16:44:10 +0100 |
|---|---|---|
| committer | Michael Vogt <egon@tas> | 2007-03-14 16:44:10 +0100 |
| commit | 9a97aa02892342fa4fe7e2f8e3bfe314f194ef0e (patch) | |
| tree | 35da7a4a20a6ed9d76c94c3f0c3c48db604b032e /python/depcache.cc | |
| parent | 2658ad16e4dc19973ef4b853b94fea6efd9ddc00 (diff) | |
| download | python-apt-9a97aa02892342fa4fe7e2f8e3bfe314f194ef0e.tar.gz | |
* python/depache.cc:
- properly support isAutoInstalled 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 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"}, |
