Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 847473
Summary: | Fix mock kernel version comparison | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Mike Miller <mtmiller> |
Component: | mock | Assignee: | Clark Williams <williams> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | mebrown, tmz, williams |
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: | 2012-11-15 02:32:47 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Mike Miller
2012-08-11 20:58:42 UTC
patch applied to git tree, queued for next release. Thanks. mock-1.1.27-2.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.27-2.el6 mock-1.1.27-2.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/mock-1.1.27-2.fc16 mock-1.0.35-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.35-1.el5 mock-1.1.27-2.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/mock-1.1.27-2.fc17 Package mock-1.1.27-2.el6: * should fix your issue, * was pushed to the Fedora EPEL 6 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=epel-testing mock-1.1.27-2.el6' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-EPEL-2012-12915/mock-1.1.27-2.el6 then log in and leave karma (feedback). It seems like yum is too old on el6 to support compareVerOnly. Am I missing something? [build@build1 ~]$ rpm -q redhat-release-server mock redhat-release-server-6Server-6.3.0.3.el6.x86_64 mock-1.1.27-2.el6.noarch [build@build1 ~]$ mock -r fedora-17-i386 init INFO: mock.py version 1.1.27 starting... ERROR: 'module' object has no attribute 'compareVerOnly' Traceback (most recent call last): File "/usr/sbin/mock", line 920, in <module> main(retParams) File "/usr/sbin/mock", line 744, in main chroot = mockbuild.backend.Root(config_opts, uidManager) File "<peak.util.decorators.rewrap wrapping mockbuild.backend.__init__ at 0x01482758>", line 3, in __init__ def __init__(self, config, uidManager): return __decorated(self, config, uidManager) File "/usr/lib/python2.6/site-packages/mockbuild/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/lib/python2.6/site-packages/mockbuild/backend.py", line 114, in __init__ self.mounts = mockbuild.mounts.Mounts(self) File "<peak.util.decorators.rewrap wrapping mockbuild.mounts.__init__ at 0x01489578>", line 3, in __init__ def __init__(self, rootObj): return __decorated(self, rootObj) File "/usr/lib/python2.6/site-packages/mockbuild/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/lib/python2.6/site-packages/mockbuild/mounts.py", line 117, in __init__ if mockbuild.util.cmpKernelVer(os.uname()[2], '2.6.29') >= 0: File "<peak.util.decorators.rewrap wrapping mockbuild.util.cmpKernelVer at 0x0147B050>", line 3, in cmpKernelVer def cmpKernelVer(str1, str2): return __decorated(str1, str2) File "/usr/lib/python2.6/site-packages/mockbuild/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/lib/python2.6/site-packages/mockbuild/util.py", line 156, in cmpKernelVer return rpmUtils.miscutils.compareVerOnly(str1, str2) AttributeError: 'module' object has no attribute 'compareVerOnly' This is true, this fix is not appropriate for EL5 or EL6 as applied currently. It looks like you are keeping EL6 in sync with Fedora so I assume you would rather have a consistent fix for all and not branch EL6 and back out this change, right? Here's another patch against the current state of the sources to make it backwards compatible. I have tested this applied to the current mock on both EL5 and EL6. From 680204c663c74386c9b491d69e0943f3cdd2370e Mon Sep 17 00:00:00 2001 From: Mike Miller <mtmiller> Date: Thu, 20 Sep 2012 07:37:59 -0400 Subject: [PATCH] Fix cmpKernelVer to be backwards compatible Replace compareVerOnly with its equivalent for systems without the latest yum. This can be reverted once everyone is on yum >= 3.4.2. --- py/mockbuild/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/mockbuild/util.py b/py/mockbuild/util.py index 14d043c..143a4eb 100644 --- a/py/mockbuild/util.py +++ b/py/mockbuild/util.py @@ -153,7 +153,7 @@ def getNEVRA(hdr): decorate(traceLog()) def cmpKernelVer(str1, str2): 'compare two kernel version strings and return -1, 0, 1 for less, equal, greater' - return rpmUtils.miscutils.compareVerOnly(str1, str2) + return rpmUtils.miscutils.compareEVR(('', str1, ''), ('', str2, '')) decorate(traceLog()) def getAddtlReqs(hdr, conf): -- 1.7.10.4 How about something like this: diff --git a/py/mockbuild/util.py b/py/mockbuild/util.py index 14d043c..2fd88ba 100644 --- a/py/mockbuild/util.py +++ b/py/mockbuild/util.py @@ -153,7 +153,10 @@ def getNEVRA(hdr): decorate(traceLog()) def cmpKernelVer(str1, str2): 'compare two kernel version strings and return -1, 0, 1 for less, equal, greater' - return rpmUtils.miscutils.compareVerOnly(str1, str2) + try: + return rpmUtils.miscutils.compareVerOnly(str1, str2) + except AttributeError, e: + return rpmUtils.miscutils.compareEVR(str1, str2) basically try to use the new compareVerOnly and if it's missing, drop back to compareEVR? Yep, that is the right way to do it, except we still need to fix the call to compareEVR like I had posted in the previous comment. This form is taken from the definition of compareVerOnly in yum. This way the two calls are functionally identical. diff --git a/py/mockbuild/util.py b/py/mockbuild/util.py index 14d043c..73e2f63 100644 --- a/py/mockbuild/util.py +++ b/py/mockbuild/util.py @@ -153,7 +153,10 @@ def getNEVRA(hdr): decorate(traceLog()) def cmpKernelVer(str1, str2): 'compare two kernel version strings and return -1, 0, 1 for less, equal, greater' - return rpmUtils.miscutils.compareVerOnly(str1, str2) + try: + return rpmUtils.miscutils.compareVerOnly(str1, str2) + except AttributeError, e: + return rpmUtils.miscutils.compareEVR(('', str1, ''), ('', str2, '')) decorate(traceLog()) def getAddtlReqs(hdr, conf): ok, running the above form of compareEVR through the regression tests now. mock-1.1.28-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.28-1.el6 mock-1.1.28-1.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/mock-1.1.28-1.fc18 mock-1.0.36-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.36-1.el5 mock-1.1.28-1.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/mock-1.1.28-1.fc17 mock-1.1.28-1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/mock-1.1.28-1.fc16 mock-1.1.28-1.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report. mock-1.1.28-1.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report. mock-1.0.36-1.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report. |