def remake(non_empty_job_list, context, cq, echo=DefaultsToConfig('echo'), new_process=DefaultsToConfig('new_process'), recurse=DefaultsToConfig('recurse')): """ Remake the selected targets (equivalent to clean and make). :param non_empty_job_list: :param context: :param cq: :param echo: :param new_process:Run the jobs in a new Python process. :param recurse: Recursive remake: put generated jobs in """ non_empty_job_list = list(non_empty_job_list) if not ask_if_sure_remake(non_empty_job_list): return db = context.get_compmake_db() for job in non_empty_job_list: mark_to_remake(job, db=db) manager = ManagerLocal(context=context, cq=cq, recurse=recurse, new_process=new_process, echo=echo) manager.add_targets(non_empty_job_list) manager.process() return raise_error_if_manager_failed(manager)
def parremake(non_empty_job_list, context, cq, n=DefaultsToConfig('max_parallel_jobs'), recurse=DefaultsToConfig('recurse'), new_process=DefaultsToConfig('new_process'), echo=DefaultsToConfig('echo')): """ Parallel equivalent of "remake". """ # TODO: test this db = context.get_compmake_db() non_empty_job_list = list(non_empty_job_list) if not ask_if_sure_remake(non_empty_job_list): return for job in non_empty_job_list: mark_to_remake(job, db=db) manager = PmakeManager(num_processes=n, context=context, cq=cq, recurse=recurse, new_process=new_process, show_output=echo) manager.add_targets(non_empty_job_list) manager.process() return raise_error_if_manager_failed(manager)