From 885b24f88e587df7b873478686509e3589e85d93 Mon Sep 17 00:00:00 2001 From: Chris Torek Date: Wed, 19 Jul 2017 18:16:48 +0000 Subject: [PATCH] container_build.py: add verbose option This is the same idea as in build.py (and in fact we use the env variable to do it, so in a sense it's not really necessary to have an option, but I think this looks cleaner). --- container_build.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/container_build.py b/container_build.py index 1af6674491..6662c3341d 100755 --- a/container_build.py +++ b/container_build.py @@ -29,14 +29,14 @@ def shell_quote(cmd): def run_docker_cmd(cmd): - run_cmd('docker run -e CXX -e DEBUG -e SANITIZE --rm -t ' + run_cmd('docker run -e V -e CXX -e DEBUG -e SANITIZE --rm -t ' '-u %d:%d -v %s:%s %s sh -c %s' % (os.getuid(), os.getgid(), BESS_DIR_HOST, BESS_DIR_CONTAINER, IMAGE, shell_quote(cmd))) def run_shell(): - run_cmd('docker run -e CXX -e DEBUG -e SANITIZE --rm -it -v %s:%s %s' % + run_cmd('docker run -e V -e CXX -e DEBUG -e SANITIZE --rm -it -v %s:%s %s' % (BESS_DIR_HOST, BESS_DIR_CONTAINER, IMAGE)) @@ -100,8 +100,12 @@ def main(): default='all', choices=cmdlist, help='Action is one of ' + ', '.join(cmdlist)) + parser.add_argument('-v', '--verbose', action='store_true', + help='pass verbose flag to build inside container') args = parser.parse_args() + if args.verbose: + os.environ['V'] = '1' cmds[args.action]()