[PATCH] createrepo_command option for mock config file
Seth Vidal
skvidal at fedoraproject.org
Tue Mar 9 15:49:43 UTC 2010
This is a simple patch to add a settable option of the createrepo command
mock will run if createrepo_on_rpms is set to True.
A point about being able to set which checksum is generate was made in
this bug report: https://bugzilla.redhat.com/show_bug.cgi?id=571636
This should provide for that kind of option setting.
thanks,
-sv
-------------- next part --------------
diff --git a/etc/mock/site-defaults.cfg b/etc/mock/site-defaults.cfg
index 3e432b5..5f0a83e 100644
--- a/etc/mock/site-defaults.cfg
+++ b/etc/mock/site-defaults.cfg
@@ -48,6 +48,7 @@
# if you want mock to automatically run createrepo on the rpms in your
# resultdir.
# config_opts['createrepo_on_rpms'] = True
+# config_opts['createrepo_command'] = '/usr/bin/createrepo -d -q -x *.src.rpm'
#############################################################################
#
diff --git a/py/mock.py b/py/mock.py
index 9c3a4fe..459eb68 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -228,6 +228,7 @@ def setup_default_config_opts(config_opts, unprivUid):
config_opts['cleanup_on_failure'] = 1
config_opts['createrepo_on_rpms'] = True
+ config_opts['createrepo_command'] = '/usr/bin/createrepo -d -q -x *.src.rpm' # default command
# (global) plugins and plugin configs.
# ordering constraings: tmpfs must be first.
# root_cache next.
@@ -382,7 +383,8 @@ def do_rebuild(config_opts, chroot, srpms):
if config_opts["createrepo_on_rpms"]:
log.info("Running createrepo on binary rpms in resultdir")
- cmd = ['/usr/bin/createrepo', '-d', '-q', '-x', '*.src.rpm', chroot.resultdir]
+ cmd = config_opts["createrepo_command"].split()
+ cmd.append(chroot.resultdir)
mock.util.do(cmd)
except (Exception, KeyboardInterrupt):
More information about the buildsys
mailing list