summaryrefslogtreecommitdiffstats
path: root/py/mock.py
diff options
context:
space:
mode:
authorMichael E Brown <michael_e_brown@dell.com>2008-01-04 14:42:58 -0600
committerMichael E Brown <michael_e_brown@dell.com>2008-01-04 14:42:58 -0600
commite964477a73d2ecb233e0e680e8c091a1f884e5a2 (patch)
tree8b635074da50f7471a59c4b11f3be979b5f1f1e4 /py/mock.py
parent63d55b3e4dcb6485e1658ab846852bfc021b15cb (diff)
downloadmock-e964477a73d2ecb233e0e680e8c091a1f884e5a2.tar.gz
mock-e964477a73d2ecb233e0e680e8c091a1f884e5a2.tar.xz
mock-e964477a73d2ecb233e0e680e8c091a1f884e5a2.zip
split up --target and --arch cmdline options.
Diffstat (limited to 'py/mock.py')
-rwxr-xr-xpy/mock.py12
1 files changed, 10 insertions, 2 deletions
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