From c4614940c04c6ce88dd4d5a3959ec1175a91fe0e Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 22 May 2008 09:18:48 +0300 Subject: [PATCH] Oops, rpmTagGetValue() expects tagname without RPMTAG_ prefix --- lib/query.c | 2 +- python/rpmmodule.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/query.c b/lib/query.c index 35c9aa2..615c88d 100644 --- a/lib/query.c +++ b/lib/query.c @@ -263,7 +263,7 @@ void rpmDisplayQueryTags(FILE * fp) while ((tname = rpmtdNextString(names))) { sname = tname + strlen("RPMTAG_"); if (rpmIsVerbose()) { - rpmTag tag = rpmTagGetValue(tname); + rpmTag tag = rpmTagGetValue(sname); rpmTagType type = rpmTagGetType(tag) & RPM_MASK_TYPE; fprintf(fp, "%-20s %6d", sname, tag); if (type > RPM_NULL_TYPE && type <= RPM_MAX_TYPE) diff --git a/python/rpmmodule.c b/python/rpmmodule.c index 456724f..015cab6 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -318,14 +318,15 @@ void init_rpm(void) #endif dict = PyDict_New(); - { const char *tname; + { const char *tname, *sname; rpmtd names = rpmTagGetNames(1); while ((tname = rpmtdNextString(names))) { - tag = PyInt_FromLong(rpmTagGetValue(tname)); + sname = tname + strlen("RPMTAG_"); + tag = PyInt_FromLong(rpmTagGetValue(sname)); PyDict_SetItemString(d, tname, tag); Py_DECREF(tag); - o = PyString_FromString(tname + strlen("RPMTAG_")); + o = PyString_FromString(sname); PyDict_SetItem(dict, tag, o); Py_DECREF(o); } -- 2.7.4