Bug 239586
Summary: | another inconsistent python binding | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Curtis Doty <curtis> |
Component: | rpm | Assignee: | Panu Matilainen <pmatilai> |
Status: | CLOSED RAWHIDE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | rawhide | CC: | herrold, redhat-bugzilla |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2007-06-26 07:52:17 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Curtis Doty
2007-05-09 17:40:19 UTC
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 |