summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/apt_pkgmodule.h1
-rw-r--r--python/makefile2
-rw-r--r--python/pkgsrcrecords.cc16
3 files changed, 18 insertions, 1 deletions
diff --git a/python/apt_pkgmodule.h b/python/apt_pkgmodule.h
index d0bfbeae..95ab3ee8 100644
--- a/python/apt_pkgmodule.h
+++ b/python/apt_pkgmodule.h
@@ -67,6 +67,7 @@ PyObject *GetDepCache(PyObject *Self,PyObject *Args);
extern PyTypeObject PkgCdromType;
PyObject *GetCdrom(PyObject *Self,PyObject *Args);
+
// PkgRecords Stuff
extern PyTypeObject PkgRecordsType;
PyObject *GetPkgRecords(PyObject *Self,PyObject *Args);
diff --git a/python/makefile b/python/makefile
index 29bbaca9..273096a7 100644
--- a/python/makefile
+++ b/python/makefile
@@ -11,7 +11,7 @@ SLIBS = -lapt-pkg
LIB_MAKES = apt-pkg/makefile
APT_PKG_SRC = apt_pkgmodule.cc configuration.cc generic.cc tag.cc string.cc \
cache.cc pkgrecords.cc pkgsrcrecords.cc sourcelist.cc \
- depcache.cc progress.cc
+ depcache.cc progress.cc cdrom.cc
SOURCE := $(APT_PKG_SRC)
include $(PYTHON_H) progress.h
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);