From 30d5a097d2bc64c739f654166df361385efd5f59 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 18 Feb 2019 12:44:19 +0800 Subject: [PATCH 1/2] gitignore: ignore env, build, pycache Signed-off-by: Sean Cross --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d2f21ac --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build/ +__pycache__/ +.env \ No newline at end of file From e66f909bfdaaeb2bebd4b67040237d205f7cb598 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 18 Feb 2019 13:54:26 +0800 Subject: [PATCH 2/2] lxbuildenv: add '-r' command to run modules under lxbuildenv This will allow us to e.g. run tests. Signed-off-by: Sean Cross --- lxbuildenv.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lxbuildenv.py b/lxbuildenv.py index 876c312..d09da85 100644 --- a/lxbuildenv.py +++ b/lxbuildenv.py @@ -276,6 +276,18 @@ def lx_main(args): elif args.lx_print_deps: lx_print_deps() + elif args.lx_run is not None: + script_name=args.lx_run[0] + get_required_dependencies(script_name) + + fixup_env(script_path, args) + check_submodules(script_path, args) + + try: + sys.exit(subprocess.Popen( + [sys.executable] + [script_name] + args.lx_run[1:]).wait()) + except: + sys.exit(1) elif args.init: if args.main is None: main_name = os.getcwd().split(os.path.sep)[-1] + '.py' @@ -443,6 +455,12 @@ if __name__ == "__main__": parser.add_argument( '-d', '--print-deps', '--lx-print-deps', dest="lx_print_deps", help="print all possible dependencies and then exit", action="store_true" ) + parser.add_argument( + "--lx-verbose", help="increase verboseness of some processes", action="store_true" + ) + parser.add_argument( + '-r', '--run', '--lx-run', dest='lx_run', help="run the given script under lxbuildenv", nargs=argparse.REMAINDER + ) args = parser.parse_args() if not lx_main(args):