From 339fada0f033950b7165fbd98efdf9323f37f6be Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Tue, 4 Dec 2007 15:38:24 -0500 Subject: add --with and --without options to enable/disable options in a srpm Signed-off-by: Michael E Brown --- py/mock.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'py/mock.py') diff --git a/py/mock.py b/py/mock.py index f626bca..7426e56 100755 --- a/py/mock.py +++ b/py/mock.py @@ -106,6 +106,12 @@ def command_parse(config_opts): parser.add_option("--define", action="append", dest="rpmmacros", default=[], type="string", metavar="'MACRO EXPR'", help="define an rpm macro (may be used more than once)") + parser.add_option("--with", action="append", dest="rpmwith", + default=[], type="string", metavar="option", + help="enable configure option for build (may be used more than once)") + parser.add_option("--without", action="append", dest="rpmwithout", + default=[], type="string", metavar="option", + help="disable configure option for build (may be used more than once)") parser.add_option("--resultdir", action="store", type="string", default=None, help="path for resulting files to be put") parser.add_option("--uniqueext", action="store", type="string", @@ -224,6 +230,12 @@ def set_config_opts_per_cmdline(config_opts, options, args): if not options.clean: config_opts['clean'] = options.clean + for option in options.rpmwith: + options.rpmmacros.append("_with_%s 1" % option) + + for option in options.rpmwithout: + options.rpmmacros.append("_with_%s 0" % option) + for macro in options.rpmmacros: try: k, v = macro.split(" ", 1) -- cgit