cpanm 1.4 is out last night. This is a major update and includes bunch of good things, and let me introduce two of them.
-q is the real quiet option
One of the things people love about cpanm is its quiet output, compared to CPAN.pm's default verbosity level. cpanm by default only prints 4 lines per module installation, namely "Fetching, Configuring, Building, Installed". We also used to have -q
option since day 1, which silences all output, which is not really that useful unless you run it from another program.
1.4 makes the -q
option less quiet - it shows only the line "Successfully installed module-ver" per one module install (or a failure message if the installation fails). This is a major achievement, and I already love this output, and now put "--quiet" into my PERL_CPANM_OPT
environment variable.
> cpanm -q DBI Plack Catalyst
Successfully reinstalled DBI-1.616
Successfully reinstalled Plack-0.9974
Successfully reinstalled Catalyst-Runtime-5.80032
3 distributions installed
Now you see it prints the number of distribution installed in the last output as well? I like it too :)
If you want the original, absolute no output option, you can just pipe the stdout and stderr output to /dev/null.
--scandeps, --format
Another great feature cpanm 1.4 brings in is the new --scandeps
command. This is now built in to the cpanminus dependency resolution system, and instead of building and installing a distribution, it scans the dependency tree and prints them as a text tree format, by default.
> cpanm -q --scandeps Catalyst::Runtime
Catalyst-Runtime-5.80032
\_ Sub-Exporter-0.982
\_ Params-Util-1.03
\_ Sub-Install-0.925
\_ Data-OptList-0.106
\_ MooseX-Emulate-Class-Accessor-Fast-0.00903
\_ namespace-clean-0.20
...
This takes into consideration that which modules you already have in your library path, so only the modules that you have to install or upgrade will be printed. If you try to see the dep tree against the vanilla perl, you can combine it with the -L
option.
--scandeps
command now takes --format
option too, so that you can print this information as a JSON/YAML format to use in a different program, or the dists
format which is pretty interesting: it prints out the AUTHOR/Dist-ver.tar.gz
format in the depth first search order, which means you can replay the installation in other machines by saving the output and the tarball as well, which you can do with the new --save-dists
option.
There are some occasions where --scandeps doesn't work like expected. See the Wiki page first if the Known Issues there explains your situation.
There are other improvements like a better core module detection in -L
, and the support for Bundle:: modules.
Try out the new great cpanm 1.4 by running cpanm --self-upgrade
.
Note that this is probably the last major update for cpanminus. I'll react to bug fixes and toolchain updates, but the effort to make a great, minimal CPAN client has reached its goal.
I still have a plan to write a new client, and that's in the works already :)
Recent Comments