upgrade to clay 2.2, fix local repository logic (doesn't use temp dir for now)