Red Hat Bugzilla – Bug 239586
another inconsistent python binding
Last modified: 2007-11-30 17:12:04 EST
The RPMTAG_FILEVERIFYFLAGS tag returns inconsistent results to python. It
appears to be same issue as:
* Wed Jun 28 2006 Paul Nasrat <firstname.lastname@example.org> - 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)
The rpm-python maintainer appears to be AWOL, so I'll add the changes myself to rpm-python-4.4.9
So that Right Fix would preclude the need fo more patches like this?
@@ -537,6 +537,8 @@
+ case RPMTAG_CHANGELOGTIME:
+ case RPMTAG_FILEVERIFYFLAGS:
forceArray = 1;
Yes. Whether the tag is an array is buried in the tagType return value.
Then this confuses me. :-/
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 18.104.22.168-rc1