diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-09 11:28:00 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-09 11:28:00 +0000 |
| commit | 2ebdc239bc9fd606bb748abd1d7ad49bea9669a3 (patch) | |
| tree | 176b2201301b9cf0b046075eba2a412d88313ffd /python/depcache.cc | |
| parent | 412fbe245a579008f1c7626e5550edbf6bedc849 (diff) | |
| download | python-apt-2ebdc239bc9fd606bb748abd1d7ad49bea9669a3.tar.gz | |
* added MinimizeUpgrade, Upgrade returns a bool now
Diffstat (limited to 'python/depcache.cc')
| -rw-r--r-- | python/depcache.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/python/depcache.cc b/python/depcache.cc index 51c25080..0d2a16b5 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -233,15 +233,30 @@ static PyObject *PkgDepCacheUpgrade(PyObject *Self,PyObject *Args) if (PyArg_ParseTuple(Args,"|b",&distUpgrade) == 0) return 0; + bool res; if(distUpgrade) - pkgDistUpgrade(*depcache); + res = pkgDistUpgrade(*depcache); else - pkgAllUpgrade(*depcache); + res = pkgAllUpgrade(*depcache); Py_INCREF(Py_None); - return HandleErrors(Py_None); + return HandleErrors(Py_BuildValue("b",res)); +} + +static PyObject *PkgDepCacheMinimizeUpgrade(PyObject *Self,PyObject *Args) +{ + pkgDepCache *depcache = GetCpp<pkgDepCache *>(Self); + + if (PyArg_ParseTuple(Args,"") == 0) + return 0; + + bool res = pkgMinimizeUpgrade(*depcache); + + Py_INCREF(Py_None); + return HandleErrors(Py_BuildValue("b",res)); } + static PyObject *PkgDepCacheReadPinFile(PyObject *Self,PyObject *Args) { pkgDepCache *depcache = GetCpp<pkgDepCache *>(Self); @@ -481,6 +496,7 @@ static PyMethodDef PkgDepCacheMethods[] = {"Upgrade",PkgDepCacheUpgrade,METH_VARARGS,"Perform Upgrade (optional boolean argument if dist-upgrade should be performed)"}, {"FixBroken",PkgDepCacheFixBroken,METH_VARARGS,"Fix broken packages"}, {"ReadPinFile",PkgDepCacheReadPinFile,METH_VARARGS,"Read the pin policy"}, + {"MinimizeUpgrade",PkgDepCacheMinimizeUpgrade, METH_VARARGS,"Go over the entire set of packages and try to keep each package marked for upgrade. If a conflict is generated then the package is restored."}, // Manipulators {"MarkKeep",PkgDepCacheMarkKeep,METH_VARARGS,"Mark package for keep"}, {"MarkDelete",PkgDepCacheMarkDelete,METH_VARARGS,"Mark package for delete (optional boolean argument if it should be purged)"}, |
