Bug 491077 - yumUtils.oldUtils is broken
Summary: yumUtils.oldUtils is broken
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: yum
Version: 5.3
Hardware: All
OS: Linux
high
urgent
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
: 491069 491070 491072 491073 491074 491075 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-19 10:46 UTC by Daniel Mach
Modified: 2014-01-21 06:12 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
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.
Clone Of:
Environment:
Last Closed: 2009-09-02 07:33:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
a patch (2.86 KB, text/plain)
2009-03-19 10:49 UTC, Daniel Mach
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1419 0 normal SHIPPED_LIVE yum bug fix update 2009-09-02 07:32:56 UTC

Description Daniel Mach 2009-03-19 10:46:34 UTC
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).

Comment 1 Daniel Mach 2009-03-19 10:49:22 UTC
Created attachment 335830 [details]
a patch

Comment 2 Daniel Mach 2009-03-19 10:51:51 UTC
*** Bug 491069 has been marked as a duplicate of this bug. ***

Comment 3 Daniel Mach 2009-03-19 10:52:07 UTC
*** Bug 491070 has been marked as a duplicate of this bug. ***

Comment 4 Daniel Mach 2009-03-19 10:52:17 UTC
*** Bug 491072 has been marked as a duplicate of this bug. ***

Comment 5 Daniel Mach 2009-03-19 10:52:30 UTC
*** Bug 491073 has been marked as a duplicate of this bug. ***

Comment 6 Daniel Mach 2009-03-19 10:52:42 UTC
*** Bug 491074 has been marked as a duplicate of this bug. ***

Comment 7 Daniel Mach 2009-03-19 10:52:55 UTC
*** Bug 491075 has been marked as a duplicate of this bug. ***

Comment 8 Daniel Mach 2009-03-19 10:54:38 UTC
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.

Comment 9 James Antill 2009-03-25 06:13:16 UTC
What is using this? And the patch contains a lot of non-critical changes.

Comment 10 Daniel Mach 2009-03-25 08:18:22 UTC
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.

Comment 11 James Antill 2009-03-25 13:19:28 UTC
 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)

Comment 12 Daniel Mach 2009-03-25 13:36:16 UTC
> -        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.

Comment 14 Denise Dumas 2009-05-20 19:57:32 UTC
Most of Daniel's patch is in so I'm putting this in Modified.  See comment 10 for details.

Comment 17 Jan Hutař 2009-06-10 09:29:45 UTC
Hello, is the current state (yum-3.2.22-14.el5.noarch) OK for you -> VERIFIED or FAILS_QA?

Comment 18 Daniel Mach 2009-06-22 15:47:10 UTC
I think you can move it to VERIFIED.
Latest code looks fine, pylint does not find any errors.

Comment 21 Ruediger Landmann 2009-09-01 18:53:32 UTC
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.

Comment 22 errata-xmlrpc 2009-09-02 07:33:12 UTC
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


Note You need to log in before you can comment on or make changes to this bug.