static PyObject * hdrExpandFilelist(hdrObject * s)
{
- DEPRECATED_METHOD;
+ DEPRECATED_METHOD("use hdr.convert() instead");
headerConvert(s->h, HEADERCONV_EXPANDFILELIST);
Py_RETURN_NONE;
static PyObject * hdrCompressFilelist(hdrObject * s)
{
- DEPRECATED_METHOD;
+ DEPRECATED_METHOD("use hdr.convert() instead");
headerConvert(s->h, HEADERCONV_COMPRESSFILELIST);
Py_RETURN_NONE;
rpmtd fileNames = rpmtdNew();
Header h = s->h;
- DEPRECATED_METHOD;
+ DEPRECATED_METHOD("obsolete method");
if (!headerIsEntry (h, RPMTAG_BASENAMES)
|| !headerIsEntry (h, RPMTAG_DIRNAMES)
|| !headerIsEntry (h, RPMTAG_DIRINDEXES))
return result;
}
-static PyObject * hdrSprintf(hdrObject * s, PyObject * args, PyObject * kwds)
-{
- DEPRECATED_METHOD;
- return hdrFormat(s, args, kwds);
-}
-
static PyObject *hdrIsSource(hdrObject *s)
{
return PyBool_FromLong(headerIsSource(s->h));
static PyObject * hdr_fiFromHeader(PyObject * s, PyObject * args, PyObject * kwds)
{
- DEPRECATED_METHOD;
+ DEPRECATED_METHOD("use convert() instead");
return PyObject_Call((PyObject *) &rpmfi_Type,
Py_BuildValue("(O)", s), kwds);
}
NULL },
{"has_key", (PyCFunction) hdrHasKey, METH_O,
NULL },
- {"sprintf", (PyCFunction) hdrSprintf, METH_VARARGS|METH_KEYWORDS,
+ {"sprintf", (PyCFunction) hdrFormat, METH_VARARGS|METH_KEYWORDS,
NULL },
{"isSource", (PyCFunction)hdrIsSource, METH_NOARGS,
NULL },
#define hdrObject_Check(v) ((v)->ob_type == &hdr_Type)
-#define DEPRECATED_METHOD \
- static int _warn = 0; \
- if (!_warn) PyErr_Warn(PyExc_DeprecationWarning, "method is deprecated"); \
- _warn = 1;
+#define DEPRECATED_METHOD(_msg) \
+ PyErr_WarnEx(PyExc_PendingDeprecationWarning, (_msg), 2);
extern PyObject * pyrpmError;
static PyObject *
spec_Parse(rpmtsObject * s, PyObject * args, PyObject * kwds)
{
- DEPRECATED_METHOD;
+ DEPRECATED_METHOD("use 'spec = rpm.spec(<specfile>)' instead");
/* we could pass in the ts from here but hardly worth the trouble */
return PyObject_Call((PyObject *) &spec_Type, args, kwds);
}