pactest: parse options before environment setup

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
This commit is contained in:
Andrew Gregory 2014-07-04 16:47:14 -04:00 committed by Allan McRae
parent 80eca94c8e
commit 0c5e80c3b4
1 changed files with 5 additions and 3 deletions

View File

@ -82,12 +82,14 @@ def create_parser():
tap.bail("Python versions before 2.7 are not supported.")
sys.exit(1)
# instantiate env and parser objects
root_path = tempfile.mkdtemp(prefix='pactest-')
env = pmenv.pmenv(root=root_path)
# parse options
opt_parser = create_parser()
(opts, args) = opt_parser.parse_args()
# instantiate env
root_path = tempfile.mkdtemp(prefix='pactest-')
env = pmenv.pmenv(root=root_path)
# add parsed options to env object
util.verbose = opts.verbose
env.pacman["debug"] = opts.debug