sort deps and mark what deps are changed