function for getting a package (and deps) into a desired root