The RPMTAG_FILEVERIFYFLAGS tag returns inconsistent results to python. It appears to be same issue as: * Wed Jun 28 2006 Paul Nasrat <pnasrat> - 4.4.2-26 - Force CHANGELOGTIME to be a list in rpm-python The bug can be reproduced by querying any package with only one file. The return val will be <type 'int'> instead of the expected <type 'list'>.
The Right Fix for determining all possible pythonically perfect returns is to use this function /** * Return tag data type from value. * @param tag tag value * @return tag data type, RPM_NULL_TYPE on not found. */ /*@unused@*/ static inline int tagType(int tag) /*@*/ { /*@-type@*/ return ((*rpmTags->tagType)(tag)); /*@=type@*/ } The rpm-python maintainer appears to be AWOL, so I'll add the changes myself to rpm-python-4.4.9 this weekend.
So that Right Fix would preclude the need fo more patches like this? --- rpm/python/header-py.c.orig +++ rpm/python/header-py.c @@ -537,6 +537,8 @@ case RPMTAG_CONFLICTNAME: case RPMTAG_CONFLICTFLAGS: case RPMTAG_CONFLICTVERSION: + case RPMTAG_CHANGELOGTIME: + case RPMTAG_FILEVERIFYFLAGS: forceArray = 1; break; case RPMTAG_SUMMARY:
Yes. Whether the tag is an array is buried in the tagType return value.
Then this confuses me. :-/ http://hg.rpm.org/rpm?cs=08400e947833 Half a patch that never needed to exist in the first place? But seriously. If the hacks need to keep swimming upstream, please send *all* of them. Otherwise Jeff's idea of Right and proper binding must prevail.
Your choice depends on rpm.org != wraptastic.org for rpm. Fork you! FWIW, Paul Nasrat is the rpm-python maintainer (I wrote the current python bindings in rpm-4.4.2 during RHL8 release ) of record. tagType() was implemented to assist with the Gawd Awful python object typing (for Pau)l like 2 years ago. FWIW, there are 2 linear searches on tag names, a largish performance hit in rpm-pythion, that have also been fixed (by using bsearch) to help Paul pretend to be an "official" rpm-python maintainer as well. Paul been AWOL for quite some time ... Do the math.
The dumb but trivial fix extending the switch-case applied to rpm.org for the next maintenance release, will look into tagType() later on.
Fixed in next rawhide push by rpm 4.4.2.1-rc1