Bug 118778
Summary: | RFE raise KeyError rather than returning "(none)" for header sequence methods | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Bob Drzyzgula <bob> | ||||||
Component: | rpm | Assignee: | Jeff Johnson <jbj> | ||||||
Status: | CLOSED DEFERRED | QA Contact: | Mike McLean <mikem> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 3.0 | CC: | msw, nobody+pnasrat | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | i386 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2004-03-20 15:47:14 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: | |||||||||
Attachments: |
|
Description
Bob Drzyzgula
2004-03-20 03:48:47 UTC
Created attachment 98705 [details]
Python script which exhibits the problem
Created attachment 98706 [details]
output of the test.py script on a Fedora Core 1 machine
Note that, at the end, the reference to h['TRIGGERTYPE'] raises a TypeError,
while printing h.sprintf("%{TRIGGERTYPE}") yieds the string "(none)". Note
moreover that this TRIGGERTYPE is a tag for the termcap package even though
termcap has no triggers. I don't think this should be happening.
Hmmm, why do you think there is a tag associated with a package when you are seeing the value "(none)" returned? Returning KeyError out of band rather than "(none)" in band is a design choice. You may agree or disagree with the choice, but I suggest checking for "(none)" and using what is already implemented rather than waiting for a more complicated mechanism that may very well take a year or more to be deployed. Defererd as an RFE until whenever ... The problem is that in these cases is that that tag *is* "associated" with the package in question, but spuriously. h.keys() returns a list of tag key numbers for the header, and the TRIGGERTYPE key is being returned for packages such as termcap that shouldn't have a TRIGGERTYPE key. If there is no TRIGGERTYPE tag associated with the package, it shouldn't be listed in h.keys(), but in over 190 packages, it is. I discovered this when writing a script that looped through all tags in all headers on a system with over 1000 packages installed. The only tag that exhibited this problem was TRIGGERTYPE. Thus I suspect that the problem is not in the lookup or formatting code, but rather in the rpmbuild or rpm -I code that generates the header in the first place; i.e. that this is a symptom of another problem, not the problem itself. In fact this is not at the moment causing me difficulty, I can work around it. But I just thought you might care that somehow rpm is systematically building corrupted packages. |