summaryrefslogtreecommitdiffstats
path: root/py
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2008-01-04 13:43:30 -0600
committerClark Williams <williams@redhat.com>2008-01-04 13:43:30 -0600
commitfac395c0fe95db2642d26a118cfed0ed8cdc95f1 (patch)
treeab08e2dcd178f848d97445c6182179e4f45e9af0 /py
parentf1a50746dc4acc3f5c9558013338880c36e51be8 (diff)
downloadmock-fac395c0fe95db2642d26a118cfed0ed8cdc95f1.tar.gz
mock-fac395c0fe95db2642d26a118cfed0ed8cdc95f1.tar.xz
mock-fac395c0fe95db2642d26a118cfed0ed8cdc95f1.zip
added --print-root-path option
Diffstat (limited to 'py')
-rwxr-xr-xpy/mock.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/py/mock.py b/py/mock.py
index d4b0885..fee2157 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -167,6 +167,10 @@ def command_parse(config_opts):
help="Disable plugin. Currently-available plugins: %s"
% repr(config_opts['plugins']))
+ parser.add_option("--print-root-path", help="print path to chroot root",
+ dest="printrootpath", action="store_true",
+ default=False)
+
(options, args) = parser.parse_args()
if len(args) and args[0] in ('chroot', 'shell',
'rebuild', 'install', 'installdeps', 'init', 'clean'):
@@ -399,6 +403,9 @@ def main(ret):
setup_default_config_opts(config_opts, unprivUid)
(options, args) = command_parse(config_opts)
+ if options.printrootpath:
+ options.verbose = 0
+
# config path -- can be overridden on cmdline
config_path = MOCKCONFDIR
if options.configdir:
@@ -461,6 +468,10 @@ def main(ret):
log.info("mock.py version %s starting..." % __VERSION__)
chroot = mock.backend.Root(config_opts, uidManager)
+ if options.printrootpath:
+ print chroot.makeChrootPath('')
+ sys.exit(0)
+
# dump configuration to log
log.debug("mock final configuration:")
for k, v in config_opts.items():