diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/cache.cc | 5 | ||||
| -rw-r--r-- | python/pkgsrcrecords.cc | 22 |
2 files changed, 22 insertions, 5 deletions
diff --git a/python/cache.cc b/python/cache.cc index c0d9048b..5c1760d4 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -105,7 +105,8 @@ static PyObject *PkgCacheUpdate(PyObject *Self,PyObject *Args) return HandleErrors(Py_None); } - +#if 0 // reopening the cache is the job of the python code now + // doing it here is wrong and broken if(pyOpProgressInst != 0) { PyOpProgress progress; progress.setCallbackInst(pyOpProgressInst); @@ -118,7 +119,7 @@ static PyObject *PkgCacheUpdate(PyObject *Self,PyObject *Args) return HandleErrors(Py_None); } } - +#endif Py_INCREF(Py_None); return HandleErrors(Py_None); diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc index ac6c09fd..c9adcb1a 100644 --- a/python/pkgsrcrecords.cc +++ b/python/pkgsrcrecords.cc @@ -82,9 +82,25 @@ static PyObject *PkgSrcRecordsAttr(PyObject *Self,char *Name) PyList_Append(List, CppPyString(*b)); return List; // todo - } else if (strcmp("Files",Name) == 0) - return 0; // todo - else if (strcmp("BuildDepends",Name) == 0) { + } else if (strcmp("Files",Name) == 0) { + PyObject *List = PyList_New(0); + + vector<pkgSrcRecords::File> f; + if(!Struct.Last->Files(f)) + return NULL; // error + + PyObject *v; + for(unsigned int i=0;i<f.size();i++) { + v = Py_BuildValue("(siss)", + f[i].MD5Hash.c_str(), + f[i].Size, + f[i].Path.c_str(), + f[i].Type.c_str()); + PyList_Append(List, v); + Py_DECREF(v); + } + return List; + } else if (strcmp("BuildDepends",Name) == 0) { PyObject *List = PyList_New(0); vector<pkgSrcRecords::Parser::BuildDepRec> bd; |
