dev-lang/mercury: more flexible keepdir for grades