summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-23 09:56:08 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-23 09:56:08 +0300
commitd38f0eb5422252c4750eac421f0fb8c7c8d43a16 (patch)
treef9c2c867d759a8963e62805ac4c3542c53cb73c5
parent66c0d4ee6b96190426d310e6b0be4c7ce3d7fe42 (diff)
downloadrpm-d38f0eb5422252c4750eac421f0fb8c7c8d43a16.tar.gz
rpm-d38f0eb5422252c4750eac421f0fb8c7c8d43a16.tar.bz2
rpm-d38f0eb5422252c4750eac421f0fb8c7c8d43a16.zip
Deprecate header filelist munging methods
- hdr.convert() is the generic way, the old stuff is not needed anymore - macro to issue warnings just once
-rw-r--r--python/header-py.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/header-py.c b/python/header-py.c
index b2f93a69e..b8943a0eb 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -124,6 +124,11 @@
* \name Class: rpm.hdr
*/
+#define DEPRECATED_METHOD \
+ static int _warn = 0; \
+ if (!_warn) PyErr_Warn(PyExc_DeprecationWarning, "method is deprecated"); \
+ _warn = 1;
+
struct hdrObject_s {
PyObject_HEAD
Header h;
@@ -200,6 +205,7 @@ static PyObject * hdrUnload(hdrObject * s, PyObject * args, PyObject *keywords)
static PyObject * hdrExpandFilelist(hdrObject * s)
{
+ DEPRECATED_METHOD;
headerConvert(s->h, HEADERCONV_EXPANDFILELIST);
Py_RETURN_NONE;
@@ -207,6 +213,7 @@ static PyObject * hdrExpandFilelist(hdrObject * s)
static PyObject * hdrCompressFilelist(hdrObject * s)
{
+ DEPRECATED_METHOD;
headerConvert(s->h, HEADERCONV_COMPRESSFILELIST);
Py_RETURN_NONE;
@@ -218,6 +225,7 @@ static PyObject * hdrFullFilelist(hdrObject * s)
rpmtd fileNames = rpmtdNew();
Header h = s->h;
+ DEPRECATED_METHOD;
if (!headerIsEntry (h, RPMTAG_BASENAMES)
|| !headerIsEntry (h, RPMTAG_DIRNAMES)
|| !headerIsEntry (h, RPMTAG_DIRINDEXES))