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

Force top level action by default, provide option to not force

parent 016fc580
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ from ..model.configuration import Configuration
def install_subcommand(sub_argparser):
cmd_parser = sub_argparser.add_parser("clone", handler=handle_clone, help="Clone a component")
cmd_parser.add_argument("component")
cmd_parser.add_argument("--force", action="store_true", help="Force execution of the root action")
cmd_parser.add_argument("--no-force", action="store_true", help="Don't force execution of the root action")
def handle_clone(args, config: Configuration):
......@@ -22,4 +22,4 @@ def handle_clone(args, config: Configuration):
print("This component does not have a git repository configured!")
return
executor = Executor(args)
executor.run(build.clone, force=args.force)
executor.run(build.clone, no_force=args.no_force)
......@@ -7,7 +7,7 @@ from ..model.configuration import Configuration
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("--force", "-f", action="store_true", help="Force execution of the root action")
cmd_parser.add_argument("--no-force", action="store_true", help="Don't force execution of the root action")
def handle_configure(args, config: Configuration):
......@@ -19,4 +19,4 @@ def handle_configure(args, config: Configuration):
exit(1)
executor = Executor(args)
executor.run(build.configure, force=args.force)
executor.run(build.configure, no_force=args.no_force)
......@@ -7,7 +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("--force", "-f", action="store_true", help="Force execution of the root 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")
cmd_parser.add_argument("--keep-tmproot", action="store_true", help="Do not remove temporary root directories")
......@@ -22,4 +22,4 @@ def handle_install(args, config: Configuration):
exit(1)
executor = Executor(args)
executor.run(build.install, force=args.force)
executor.run(build.install, no_force=args.no_force)
......@@ -16,8 +16,8 @@ class Executor:
self._failed_actions: List[Action] = []
self._pool = futures.ThreadPoolExecutor(max_workers=threads, thread_name_prefix="Builder")
def run(self, action, force=False):
self._collect_actions(action, force=force)
def run(self, action, no_force=False):
self._collect_actions(action, force=not no_force)
self._pending_actions.sort(key=lambda a: a.qualified_name)
if not self._pending_actions:
......
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