diff options
author | Clark Williams <williams@redhat.com> | 2008-01-04 13:43:30 -0600 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2008-01-04 13:43:30 -0600 |
commit | fac395c0fe95db2642d26a118cfed0ed8cdc95f1 (patch) | |
tree | ab08e2dcd178f848d97445c6182179e4f45e9af0 /py | |
parent | f1a50746dc4acc3f5c9558013338880c36e51be8 (diff) | |
download | mock-fac395c0fe95db2642d26a118cfed0ed8cdc95f1.tar.gz mock-fac395c0fe95db2642d26a118cfed0ed8cdc95f1.tar.xz mock-fac395c0fe95db2642d26a118cfed0ed8cdc95f1.zip |
added --print-root-path option
Diffstat (limited to 'py')
-rwxr-xr-x | py/mock.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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(): |