def clean_targets(job_list, db): # print('clean_targets (%r)' % job_list) job_list = set(job_list) # now we need to delete the definition closure from compmake.jobs.queries import definition_closure closure = definition_closure(job_list, db) basic = job_list - closure from compmake.jobs.queries import parents other_clean = set() for job_id in job_list: other_clean.update(parents(job_id, db)) other_clean = other_clean - closure # # print('deleting: %r' % closure) # print('only cleaning: %r' % basic) # print('other cleaning: %r' % other_clean) # for job_id in closure | basic | other_clean: clean_cache_relations(job_id, db) # delete all in closure for job_id in closure: from compmake.jobs.storage import delete_all_job_data delete_all_job_data(job_id, db) # just remove cache in basic for job_id in basic: # Cleans associated objects if job_cache_exists(job_id, db): delete_job_cache(job_id, db)
def direct_uptodate_deps_inverse_closure(job_id, db): """ Closure of direct_uptodate_deps_inverse: all jobs that depend on this. """ from compmake.jobs.queries import parents # all parents dep_inv = parents(job_id, db) # plus their definition closure from compmake.jobs.queries import definition_closure closure = definition_closure(dep_inv, db) # this is not true in general # assert not closure & dep_inv dep_inv.update(closure) # plus the ones that were defined by it from compmake.jobs.storage import get_job_cache if get_job_cache(job_id, db).state == Cache.DONE: dep_inv.update(jobs_defined(job_id, db)) return dep_inv