RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 20-Aug-2009 18:32:43 Branch: HEAD Handle: 2009082016324200 Modified files: rpm/python header-py.c Log: - rpm.org: Add isSource() method to python header object (ticket #32). Summary: Revision Changes Path 1.110 +8 -0 rpm/python/header-py.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/python/header-py.c ============================================================================ $ cvs diff -u -r1.109 -r1.110 header-py.c --- rpm/python/header-py.c 21 Jul 2009 22:33:25 -0000 1.109 +++ rpm/python/header-py.c 20 Aug 2009 16:32:42 -0000 1.110 @@ -149,6 +149,12 @@ return 0; } +static PyObject *hdrIsSource(hdrObject *s) +{ + int isSource = !headerIsEntry(s->h, RPMTAG_SOURCERPM); + return PyBool_FromLong(isSource); +} + /** \ingroup python * \name Class: Rpmhdr */ @@ -306,6 +312,8 @@ NULL }, {"sprintf", (PyCFunction) hdrSprintf, METH_VARARGS|METH_KEYWORDS, NULL }, + {"isSource", (PyCFunction)hdrIsSource, METH_NOARGS, + NULL }, {"dsOfHeader", (PyCFunction)hdr_dsOfHeader, METH_NOARGS, NULL}, @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org