From 2f8f815efac944fdaf1f0670f8322a229bf993ee Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 1 Jul 2005 21:44:17 +0000 Subject: * SetReInstall() added to depcache --- debian/changelog | 2 +- python/depcache.cc | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b6f07320..c46b89fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-apt (0.6.13) breezy; urgency=low +python-apt (0.6.12ubuntu1mvo1) breezy; urgency=low * support for Marked{Downgrade,Reinstall} added * Cache.GetChanges() added diff --git a/python/depcache.cc b/python/depcache.cc index 49049c4b..2d7161a3 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -294,6 +294,23 @@ static PyObject *PkgDepCacheMarkKeep(PyObject *Self,PyObject *Args) return HandleErrors(Py_None); } +static PyObject *PkgDepCacheSetReInstall(PyObject *Self,PyObject *Args) +{ + pkgDepCache *depcache = GetCpp(Self); + + PyObject *PackageObj; + char value = 0; + if (PyArg_ParseTuple(Args,"O!b",&PackageType,&PackageObj, &value) == 0) + return 0; + + pkgCache::PkgIterator &Pkg = GetCpp(PackageObj); + depcache->SetReInstall(Pkg,value); + + Py_INCREF(Py_None); + return HandleErrors(Py_None); +} + + static PyObject *PkgDepCacheMarkDelete(PyObject *Self,PyObject *Args) { pkgDepCache *depcache = GetCpp(Self); @@ -310,6 +327,7 @@ static PyObject *PkgDepCacheMarkDelete(PyObject *Self,PyObject *Args) return HandleErrors(Py_None); } + static PyObject *PkgDepCacheMarkInstall(PyObject *Self,PyObject *Args) { pkgDepCache *depcache = GetCpp(Self); @@ -470,6 +488,7 @@ static PyMethodDef PkgDepCacheMethods[] = {"MarkKeep",PkgDepCacheMarkKeep,METH_VARARGS,"Mark package for keep"}, {"MarkDelete",PkgDepCacheMarkDelete,METH_VARARGS,"Mark package for delete (optional boolean argument if it should be purged)"}, {"MarkInstall",PkgDepCacheMarkInstall,METH_VARARGS,"Mark package for Install"}, + {"SetReInstall",PkgDepCacheSetReInstall,METH_VARARGS,"Set if the package should be reinstalled"}, // state information {"IsUpgradable",PkgDepCacheIsUpgradable,METH_VARARGS,"Is pkg upgradable"}, {"IsNowBroken",PkgDepCacheIsNowBroken,METH_VARARGS,"Is pkg is now broken"}, -- cgit v1.2.3