diff options
author | Todd Zullinger <tmz@pobox.com> | 2007-12-04 15:38:24 -0500 |
---|---|---|
committer | Michael E Brown <michael_e_brown@dell.com> | 2007-12-04 17:28:01 -0600 |
commit | 339fada0f033950b7165fbd98efdf9323f37f6be (patch) | |
tree | 785c473d5341f5d3feb7172da4352ccf24429c8c /py/mock.py | |
parent | 2679d3cae92a1178b586fc1c07b1fbfcac88972a (diff) | |
download | mock-339fada0f033950b7165fbd98efdf9323f37f6be.tar.gz mock-339fada0f033950b7165fbd98efdf9323f37f6be.tar.xz mock-339fada0f033950b7165fbd98efdf9323f37f6be.zip |
add --with and --without options to enable/disable options in a srpm
Signed-off-by: Michael E Brown <michael_e_brown@dell.com>
Diffstat (limited to 'py/mock.py')
-rwxr-xr-x | py/mock.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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) |