summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael E Brown <michael_e_brown@dell.com>2007-12-04 17:00:26 -0600
committerMichael E Brown <michael_e_brown@dell.com>2007-12-04 17:00:26 -0600
commit38751f05060ef76e8777a21f3e5fe88f4baf7001 (patch)
tree5c825a63e1fe343f8078671a9d8b22fef25b23d5
parente1d2de8c53bd0f39e1efb9ca6c95d454552123b0 (diff)
downloadmock-38751f05060ef76e8777a21f3e5fe88f4baf7001.tar.gz
mock-38751f05060ef76e8777a21f3e5fe88f4baf7001.tar.xz
mock-38751f05060ef76e8777a21f3e5fe88f4baf7001.zip
error when trying to build multiple srpms without --resultdir.
-rwxr-xr-xpy/mock.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/py/mock.py b/py/mock.py
index cb558e0..e40f029 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -213,7 +213,7 @@ def setup_default_config_opts(config_opts):
}
decorate(traceLog(log))
-def set_config_opts_per_cmdline(config_opts, options):
+def set_config_opts_per_cmdline(config_opts, options, args):
"takes processed cmdline args and sets config options."
# do some other options and stuff
if options.arch:
@@ -245,6 +245,10 @@ def set_config_opts_per_cmdline(config_opts, options):
raise mock.exception.BadCmdline(
"Must specify --resultdir when using --cleanup-after")
+ if len(args) > 1 and not options.resultdir:
+ raise mock.exception.BadCmdline(
+ "Must specify --resultdir when building multiple RPMS.")
+
if options.cleanup_after == False:
config_opts['cleanup_on_success'] = False
config_opts['cleanup_on_failure'] = False
@@ -378,7 +382,7 @@ def main(ret):
# cmdline options override config options
log.info("mock.py version %s starting..." % __VERSION__)
- set_config_opts_per_cmdline(config_opts, options)
+ set_config_opts_per_cmdline(config_opts, options, args)
# do whatever we're here to do
chroot = mock.backend.Root(config_opts, uidManager)