yumUtils.oldUtils contains a lot of errors and is completely unusable. I suggest to review the code and fix it. I already fixed most annoying errors (see my patch).
Created attachment 335830 [details] a patch
*** Bug 491069 has been marked as a duplicate of this bug. ***
*** Bug 491070 has been marked as a duplicate of this bug. ***
*** Bug 491072 has been marked as a duplicate of this bug. ***
*** Bug 491073 has been marked as a duplicate of this bug. ***
*** Bug 491074 has been marked as a duplicate of this bug. ***
*** Bug 491075 has been marked as a duplicate of this bug. ***
Sorry for submitting so many duplicate bugs, Bugzilla refused to create a bug and ended with a proxy error. So I tried it several times.
What is using this? And the patch contains a lot of non-critical changes.
We use it in release-engineering tools for compatibility with rhel4. If you don't like the patch, just write another one. I strongly suggest to use pylint to discover all issues in this module, I fixed those affecting our scripts.
Ok, I did: diff --git a/rpmUtils/oldUtils.py b/rpmUtils/oldUtils.py index 1216ce4..5011e8f 100644 --- a/rpmUtils/oldUtils.py +++ b/rpmUtils/oldUtils.py @@ -6,7 +6,12 @@ import os import gzip import sys from gzip import write32u, FNAME +from urlgrabber.grabber import URLGrabError +from zlib import error as zlibError +def log(num, msg): + print >>sys.stderr, msg +errorlog = log def _(msg): return msg @@ -168,6 +173,8 @@ def _gzipOpen(filename, mode="rb", compresslevel=9): return GzipFile(filename, mode, compresslevel) class RPM_Base_Work: + def __init__(self): + self.hdr = None def _getTag(self, tag): if self.hdr is None: ....which I hope is everything you wanted/needed. Why did you do this bit: - ts.setVSFlags(~(rpm._RPMVSF_NOSIGNATURES)) + ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
> - ts.setVSFlags(~(rpm._RPMVSF_NOSIGNATURES)) > + ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) If I recall it right, it throws an exception when a rpm is not signed. But we need get headers even for unsigned rpms.
Most of Daniel's patch is in so I'm putting this in Modified. See comment 10 for details.
Hello, is the current state (yum-3.2.22-14.el5.noarch) OK for you -> VERIFIED or FAILS_QA?
I think you can move it to VERIFIED. Latest code looks fine, pylint does not find any errors.
Release note added. If any revisions are required, please set the "requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Current versions of yum include code for old yum utilities. The continued availability of the old utilities allows developers to ensure backward compatibility of yum features with the versions of yum shipped with earlier versions of Red Hat Enterprise Linux. A number of errors in this code have been corrected, ensuring that tests against these old utilities remain valid.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-1419.html