def main(__interactive__: bool, force: bool) -> None: """ Updates the configuration if the program is to be run interactively, then install necessary items :param __interactive__: if the config has to be updated :param force: True to force reinstall of the programs, else will only install the ones that are not installed """ if __interactive__ and update.update(): logging.error("An error occurred, could not finish configuration") return 1 try: install(force) setup_coredumps() hooks.load_plugins() hooks.configure(force) except (exceptions.InstallationErrorException, exceptions.DistributionNotSupportedException) as exception: logging.error(exception) logging.error( "Configure script failed. Please rerun it after correcting errors. You can add --default in order" " to skip questions") return 1 finally: logging.verbose("Cleaning environment")
def main(__interactive__: bool, force: bool) -> None: """ Updates the configuration if the program is to be run interactively, then install necessary items :param __interactive__: if the config has to be updated :param force: True to force reinstall of the programs, else will only install the ones that are not installed """ if __interactive__ and update.update(): logging.error("An error occurred, could not finish configuration") return 1 try: install(force) setup_coredumps() hooks.load_plugins() hooks.configure(force) except (exceptions.InstallationErrorException, exceptions.DistributionNotSupportedException) as exception: logging.error(exception) logging.error("Configure script failed. Please rerun it after correcting errors. You can add --default in order" " to skip questions") return 1 finally: logging.verbose("Cleaning environment")
def configure(self, compiler: Compiler) -> None: """ Configures the environment to run with the given compiler :param compiler: the compiler to use """ try: with TestRunner.EnvManager(compiler, "configure"): self.assertFalse( dependencies.install(False), "Could not install dependencies for {} with{} bitcode".format( compiler.name, "out" if compiler.bitcode else "" ), ) for plugin_info in compiler.plugins: log_file = "{}-{}-configuration".format(plugin_info.package, plugin_info.name) with TestRunner.EnvManager(compiler, log_file): plugin = [ subclass for subclass in get_subclasses(BasePlugin) if subclass.__name__.lower() == plugin_info.name ][0] self.assertFalse(plugin().configure(force=False)) finally: compiler.is_configured.set()
def configure(self, compiler: Compiler) -> None: """ Configures the environment to run with the given compiler :param compiler: the compiler to use """ try: with TestRunner.EnvManager(compiler, "configure"): self.assertFalse( dependencies.install(False), "Could not install dependencies for {} with{} bitcode". format(compiler.name, "out" if compiler.bitcode else "")) for plugin_info in compiler.plugins: log_file = "{}-{}-configuration".format( plugin_info.package, plugin_info.name) with TestRunner.EnvManager(compiler, log_file): plugin = [ subclass for subclass in get_subclasses(BasePlugin) if subclass.__name__.lower() == plugin_info.name ][0] self.assertFalse(plugin().configure(force=False)) finally: compiler.is_configured.set()