summaryrefslogtreecommitdiff
path: root/python/pkgsrcrecords.cc
diff options
context:
space:
mode:
Diffstat (limited to 'python/pkgsrcrecords.cc')
-rw-r--r--python/pkgsrcrecords.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc
index f9a420b9..fb66284a 100644
--- a/python/pkgsrcrecords.cc
+++ b/python/pkgsrcrecords.cc
@@ -80,6 +80,22 @@ static PyObject *PkgSrcRecordsAttr(PyObject *Self,char *Name)
return List; // todo
} else if (strcmp("Files",Name) == 0)
return 0; // todo
+ else if (strcmp("BuildDepends",Name) == 0) {
+ PyObject *List = PyList_New(0);
+
+ vector<pkgSrcRecords::Parser::BuildDepRec> bd;
+ if(!Struct.Last->BuildDepends(bd, false /* arch-only*/))
+ return NULL; // error
+
+ PyObject *v;
+ for(unsigned int i=0;i<bd.size();i++) {
+ v = Py_BuildValue("(ssii)", bd[i].Package.c_str(),
+ bd[i].Version.c_str(), bd[i].Op, bd[i].Type);
+ PyList_Append(List, v);
+ Py_DECREF(v);
+ }
+ return List;
+ }
}
return Py_FindMethod(PkgSrcRecordsMethods,Self,Name);