From e964477a73d2ecb233e0e680e8c091a1f884e5a2 Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Fri, 4 Jan 2008 14:42:58 -0600 Subject: split up --target and --arch cmdline options. --- py/mock.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'py/mock.py') diff --git a/py/mock.py b/py/mock.py index fee2157..fbe71c2 100755 --- a/py/mock.py +++ b/py/mock.py @@ -124,8 +124,10 @@ def command_parse(config_opts): dest="cleanup_after", default=None, help="Dont clean chroot after building. If automatic" " cleanup is enabled, use this to disable.", ) - parser.add_option("--target", "--arch", action ="store", dest="arch", - default=None, help="target build arch") + parser.add_option("--arch", action ="store", dest="arch", + default=None, help="Use to set kernel personality() to use to build.") + parser.add_option("--target", action ="store", dest="rpmbuild_arch", + default=None, help="passed to rpmbuild as --target") parser.add_option("-D", "--define", action="append", dest="rpmmacros", default=[], type="string", metavar="'MACRO EXPR'", help="define an rpm macro (may be used more than once)") @@ -247,6 +249,7 @@ def setup_default_config_opts(config_opts, unprivUid): config_opts['use_host_resolv'] = True config_opts['chroot_setup_cmd'] = 'install buildsys-build' config_opts['target_arch'] = 'i386' + config_opts['rpmbuild_arch'] = None # <-- None means set automatically from target_arch config_opts['yum.conf'] = '' config_opts['more_buildreqs'] = {} config_opts['files'] = {} @@ -262,6 +265,11 @@ def set_config_opts_per_cmdline(config_opts, options, args): # do some other options and stuff if options.arch: config_opts['target_arch'] = options.arch + if options.rpmbuild_arch: + config_opts['rpmbuild_arch'] = options.rpmbuild_arch + elif config_opts['rpmbuild_arch'] is None: + config_opts['rpmbuild_arch'] = config_opts['target_arch'] + if not options.clean: config_opts['clean'] = options.clean -- cgit