From d724db2ef374c97e05f19d6e0bedb6a933426147 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 27 Jul 2009 11:17:52 +0200 Subject: * python/tag.cc: - merge patch from John Wright that adds FindRaw method (closes: #538723) --- python/tag.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'python') diff --git a/python/tag.cc b/python/tag.cc index 217be290..6fe97ed5 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -92,6 +92,29 @@ static PyObject *TagSecFind(PyObject *Self,PyObject *Args) return PyString_FromStringAndSize(Start,Stop-Start); } +static char *doc_FindRaw = "FindRaw(Name) -> String/None"; +static PyObject *TagSecFindRaw(PyObject *Self,PyObject *Args) +{ + char *Name = 0; + char *Default = 0; + if (PyArg_ParseTuple(Args,"s|z",&Name,&Default) == 0) + return 0; + + unsigned Pos; + if (GetCpp(Self).Find(Name,Pos) == false) + { + if (Default == 0) + Py_RETURN_NONE; + return PyString_FromString(Default); + } + + const char *Start; + const char *Stop; + GetCpp(Self).Get(Start,Stop,Pos); + + return PyString_FromStringAndSize(Start,Stop-Start); +} + static char *doc_FindFlag = "FindFlag(Name) -> integer/none"; static PyObject *TagSecFindFlag(PyObject *Self,PyObject *Args) { @@ -355,6 +378,7 @@ static PyMethodDef TagSecMethods[] = { // Query {"Find",TagSecFind,METH_VARARGS,doc_Find}, + {"FindRaw",TagSecFindRaw,METH_VARARGS,doc_FindRaw}, {"FindFlag",TagSecFindFlag,METH_VARARGS,doc_FindFlag}, {"Bytes",TagSecBytes,METH_VARARGS,doc_Bytes}, -- cgit v1.2.3 From 0181690f1cdc4ffbc3192b9b93d13d9a9a1f8f83 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 14:10:35 +0200 Subject: * python/cache.cc: - Support Breaks, Enhances dependency types (Closes: #416247) --- debian/changelog | 7 +++++++ python/cache.cc | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/debian/changelog b/debian/changelog index a47510c4..7fb62a1d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +python-apt (0.7.11.2) unstable; urgency=low + + * python/cache.cc: + - Support Breaks, Enhances dependency types (Closes: #416247) + + -- Julian Andres Klode Thu, 30 Jul 2009 14:08:30 +0200 + python-apt (0.7.11.1) unstable; urgency=low [ Stephan Peijnik ] diff --git a/python/cache.cc b/python/cache.cc index 0c59f561..c7e5e76e 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -502,7 +502,7 @@ static PyObject *MakeDepends(PyObject *Owner,pkgCache::VerIterator &Ver, { "", "Depends","PreDepends","Suggests", "Recommends","Conflicts","Replaces", - "Obsoletes" + "Obsoletes", "Breaks", "Enhances" }; PyObject *Dep = PyString_FromString(Types[Start->Type]); LastDepType = Start->Type; -- cgit v1.2.3