Bug 604277

Summary: mrepo fails to obtain createrepo version number, breaks metadata generation
Product: [Fedora] Fedora Reporter: Kelvin Ku <kelvin>
Component: mrepoAssignee: James Findley <sixy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: dag, sandro, susi.lehtola
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: mrepo-0.8.7-1.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-30 01:04:58 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 Kelvin Ku 2010-06-15 18:57:23 UTC
Description of problem:

mrepo fails to obtain the createrepo version number. This prevents the repomd format metadata from being generated.

Version-Release number of selected component (if applicable):

mrepo-0.8.6-5.fc12.noarch

How reproducible:

Always

Steps to Reproduce:
1. Configure a repomd format repo
2. Run mrepo, e.g., with "mrepo -fg <repo>"
  
Actual results:

$ mrepo -c scratch/mrepo.conf -fg f12-i386
/usr/bin/mrepo:18: DeprecationWarning: The popen2 module is deprecated.  Use the subprocess module.
  import os, sys, glob, re, shutil, getopt, popen2
/usr/bin/mrepo:19: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import ConfigParser, urlparse, sha, types, traceback
f12-i386: Generating Fedora Core 12 (i386) meta-data
mrepo: f12-i386: Version of createrepo could not be found. Assuming newer than 0.4.6.
mrepo: f12-i386: Version of createrepo could not be found. Assuming newer than 0.4.6.
Error: groupfile /extra_disk/mrepo/www/f12-i386/RPMS.releases/RPMS.releases/comps.xml cannot be found.
mrepo: Generating repo failed for releases with message:
  /usr/bin/createrepo failed with return code: 256
mrepo: f12-i386: Version of createrepo could not be found. Assuming newer than 0.4.6.
Error: groupfile /extra_disk/mrepo/www/f12-i386/RPMS.updates/RPMS.updates/comps.xml cannot be found.
mrepo: Generating repo failed for updates with message:
  /usr/bin/createrepo failed with return code: 256


Expected results:

Success, creation of metadata

Additional info:

These lines in mrepo (/usr/bin/mrepo) attempt to get the createrepo version number from the "genpkgmetadata" class:

 813         ### Find the createrepo version we are using (due to groupfile usage changes)
 814         createrepo_version = None
 815         groupfilename = 'RPMS.%s/comps.xml' % self.name
 816         try:
 817             sys.path.append("/usr/share/createrepo")
 818             import genpkgmetadata
 819             createrepo_version = genpkgmetadata.__version__
 820             sys.path.remove("/usr/share/createrepo")
 821             del genpkgmetadata
 822         except:
 823             pass

whereas __version__ has been moved to the "createrepo" class in some revision of creatrepo. This patch makes it work:

--- /usr/bin/mrepo      2009-10-18 15:35:58.000000000 -0400
+++ mrepo       2010-06-15 14:20:01.197548000 -0400
@@ -18,6 +18,7 @@
 import os, sys, glob, re, shutil, getopt, popen2
 import ConfigParser, urlparse, sha, types, traceback
 import time
+import createrepo
 
 __version__ = "$Revision: 6444 $"
 # $Source$
@@ -811,16 +812,8 @@
             raise mrepoGenerateException('Command createrepo is not found. Skipping.')
 
         ### Find the createrepo version we are using (due to groupfile usage changes)
-        createrepo_version = None
         groupfilename = 'RPMS.%s/comps.xml' % self.name
-        try:
-            sys.path.append("/usr/share/createrepo")
-            import genpkgmetadata
-            createrepo_version = genpkgmetadata.__version__
-            sys.path.remove("/usr/share/createrepo")
-            del genpkgmetadata
-        except:
-            pass
+        createrepo_version = createrepo.__version__
 
         ### If version < 0.4.6, then use the old createrepo behaviour
         if not createrepo_version:

Comment 1 Susi Lehtola 2010-06-16 19:08:05 UTC
I'm hoping upstream (Dag) will fix this. I'm a bit reluctant to do such a drastic change, without knowing what might break as a result.

In fact, I'm not involved any more with the mainership of local Fedora install mirrors, so mrepo is one of the odd packages in my group, and I'm probably going to orphan it soon.

Comment 2 Fedora Admin XMLRPC Client 2010-07-05 12:34:20 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Fedora Update System 2010-07-08 12:38:22 UTC
mrepo-0.8.7-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/mrepo-0.8.7-1.fc12

Comment 4 Fedora Update System 2010-07-08 12:38:37 UTC
mrepo-0.8.7-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/mrepo-0.8.7-1.fc13

Comment 5 Fedora Update System 2010-07-08 18:14:49 UTC
mrepo-0.8.7-1.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mrepo'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mrepo-0.8.7-1.fc12

Comment 6 Fedora Update System 2010-07-08 18:15:08 UTC
mrepo-0.8.7-1.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mrepo'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mrepo-0.8.7-1.fc13

Comment 7 Fedora Update System 2010-07-09 15:26:38 UTC
mrepo-0.8.7-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/mrepo-0.8.7-1.el5

Comment 8 Fedora Update System 2010-07-09 18:56:43 UTC
mrepo-0.8.7-1.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mrepo'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mrepo-0.8.7-1.el5

Comment 9 Fedora Update System 2010-07-30 01:04:43 UTC
mrepo-0.8.7-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.

Comment 10 Fedora Update System 2010-07-30 08:32:13 UTC
mrepo-0.8.7-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2010-07-30 08:38:17 UTC
mrepo-0.8.7-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.