Skip to content
Snippets Groups Projects
Commit c15d274e authored by Filippo Cremonese's avatar Filippo Cremonese
Browse files

Add --no-deps option to configure and install

parent 98a3ba50
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ def install_subcommand(sub_argparser):
cmd_parser = sub_argparser.add_parser("configure", handler=handle_configure, help="Run configure script")
cmd_parser.add_argument("component")
cmd_parser.add_argument("--no-force", action="store_true", help="Don't force execution of the root action")
cmd_parser.add_argument("--no-deps", action="store_true", help="Only execute the requested action")
def handle_configure(args, config: Configuration):
......@@ -19,4 +20,4 @@ def handle_configure(args, config: Configuration):
exit(1)
executor = Executor(args)
executor.run(build.configure, no_force=args.no_force)
executor.run(build.configure, no_force=args.no_force, no_deps=args.no_deps)
......@@ -7,6 +7,7 @@ from ..model.configuration import Configuration
def install_subcommand(sub_argparser):
cmd_parser = sub_argparser.add_parser("install", handler=handle_install, help="Build and install a component")
cmd_parser.add_argument("component")
cmd_parser.add_argument("--no-deps", action="store_true", help="Only execute the requested action")
cmd_parser.add_argument("--no-force", action="store_true", help="Don't force execution of the root action")
cmd_parser.add_argument("--no-merge", action="store_true", help="Do not merge files into orchestra root")
cmd_parser.add_argument("--create-binary-archives", action="store_true", help="Create binary archives")
......@@ -22,4 +23,4 @@ def handle_install(args, config: Configuration):
exit(1)
executor = Executor(args)
executor.run(build.install, no_force=args.no_force)
executor.run(build.install, no_force=args.no_force, no_deps=args.no_deps)
......@@ -17,8 +17,8 @@ class Executor:
self._failed_actions: List[Action] = []
self._pool = futures.ThreadPoolExecutor(max_workers=threads, thread_name_prefix="Builder")
def run(self, action, no_force=False):
self._collect_actions(action, force=not no_force)
def run(self, action, no_force=False, no_deps=False):
self._collect_actions(action, force=not no_force, no_deps=no_deps)
self._pending_actions.sort(key=lambda a: a.qualified_name)
if not self._pending_actions:
......@@ -71,12 +71,15 @@ class Executor:
status_bar.status_format = msg
status_bar.close()
def _collect_actions(self, action: Action, force=False):
def _collect_actions(self, action: Action, force=False, no_deps=False):
if not force and action.is_satisfied(recursively=True):
return
if action not in self._pending_actions:
self._pending_actions.append(action)
if no_deps:
return
for dep in action.dependencies:
self._collect_actions(dep)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment