This simple tool wraps cpm and carton in order to test and install dependent modules quickly (and locally) while still writing a cpanfile.snapshot.
It installs the modules declared in the current working directory's cpanfile, it installs modules into ./local/
and writes cpanfile.snapshot to the working directory.
This is useful during development to install necessary dependencies while still allowing the later build processes to repeat the build using the snapshot.
It resolves modules from our darkpan and falls back to the cpan metadb.
This combination allows installing our local modules while still allowing pinning of modules via the cpanfile all the way back into backpanned modules.
Usage is simply $ perldeps
.
Any additional arguments are passed to cpm.
For example $ perldeps -w 8
to use more concurrency in building.
Note that the cpanfile.snapshot should be committed to the project (and updated as needed) while the local/
directory should not be (and probably should be gitignored).
For the time being (until I figure out how) dependencies that are satisfied will not be updated.
In order to update modules (both installed and in the snapshot) either update the cpanfile to require a newer version, install the newer version via another install tool into local/
and then rerun this one to get the snapshot, or simply remove the local directory and reinstall everything.
These are tools I built at $work to facilitate our CI/CD workflow. CI builds a project into a cpan-style dist with distify. Then CI pushes it into an opan/darkpan. I also needed a module installer that both could use the darkpan with upstream cpan and metadb (forget what the problems were here with cpm/carton) and generate a cpanfile.snapshot.