From d2423e2c28df63cb0a235f822a9588f8a221600a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 8 Jul 2009 20:18:36 +0200 Subject: python/pkgsrcrecords.cc: Unify dep handling -- part 2: SourceRecords.build_depends Change apt_pkg.SourceRecords.build_depends to match exactly the interface of Version.depends_list_str just with different keys (e.g. Build-Depends). + Closes: #468123 - there is no need anymore for binding CompType or CompTypeDeb, because we don't return integer values for CompType anymore. --- debian/changelog | 6 +++++- python/pkgsrcrecords.cc | 51 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 581e1be1..8bc3e320 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,7 +25,11 @@ python-apt (0.7.92) UNRELEASED; urgency=low * Unification of dependency handling: - apt_pkg.parse_[src_]depends() now use CompType instead of CompTypeDeb (i.e. < instead of <<) to match the interface of Version.depends_list_str - + - apt_pkg.SourceRecords.build_depends matches exactly the interface of + Version.depends_list_str just with different keys (e.g. Build-Depends). + + Closes: #468123 - there is no need anymore for binding CompType or + CompTypeDeb, because we don't return integer values for CompType + anymore. [ Sebastian Heinlein ] * apt/progress.py: Extract the package name from the status message diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc index 187050b7..06fd4e3b 100644 --- a/python/pkgsrcrecords.cc +++ b/python/pkgsrcrecords.cc @@ -151,6 +151,54 @@ static PyObject *PkgSrcRecordsGetFiles(PyObject *Self,void*) { } static PyObject *PkgSrcRecordsGetBuildDepends(PyObject *Self,void*) { + PkgSrcRecordsStruct &Struct = GetStruct(Self,"BuildDepends"); + if (Struct.Last == 0) + return 0; + + PyObject *Dict = PyDict_New(); + PyObject *Dep = 0; + PyObject *LastDep = 0; + PyObject *OrGroup = 0; + + vector bd; + if(!Struct.Last->BuildDepends(bd, false /* arch-only*/)) + return NULL; // error + + PyObject *v; + for(unsigned int i=0;i