NAME
App::MechaCPAN::Install - Mechanize the installation of CPAN modules.
SYNOPSIS
# Install Catalyst into local/
user@host:~$ mechacpan install Catalyst
DESCRIPTION
user@host:~$ mechacpan install Catalyst
The install
command is used for installing specific modules. All modules are installed into the local/
directory. It can accept module names in various formats. This includes:
# Install from:
foo-bar.tar.gz # * an archive
foo::bar # * a CPAN module
foo::bar@1.0 # * a specific module version
foo::bar~<1.0 # * a module with version < 1.0
BAZ/foo-bar.tar.gz # * a PAUSE URL
B/BA/BAZ/foo-bar.tar.gz # * a PAUSE URL
https://example.com/foo-bar.zip # * a URL
https://example.com/foo-bar.git # * a git repo
https://example.com/foo-bar.git@master # * a git branch
MetaCPAN is used to search for modules by name.
Methods
go( \%opts, @srcs )
There is only a single public function that should be called. This will install the modules listed in @srcs
using the options in \%opts
. The options available are listed in the arguments section below.
# Example of calling go
App::MecahCPAN::Install->go({}, 'Try::Tiny');
Arguments
skip-tests
skip-tests-for
By default the tests of each module will be ran. If you do not want to run tests when installing modules, use this option. Alternatively, you can use skip-tests-for
to specify module names that will skip the tests for that module.
# Examples of --skip-tests
mechacpan install Try::Tiny --skip-tests
mechacpan install Catalyst --skip-tests-for=Moose
install-man
By default, man pages are not installed. Use this option to install the man pages.
source
Add a source translation to the installation. This can be used to translate a module name into another form, like using an exact version of a module or pull another module from its git repo. This can be repeated multiple times for multiple translations.
# Examples of --source
mechacpan install Catalyst --source Try::Tiny=ETHER/Try-Tiny-0.24
mechacpan install Catalyst --source Catalyst=git://git.shadowcat.co.uk/catagits/Catalyst-Runtime.git
only-sources
Do not use modules not listed in the source list. This means if you do not specify every module and every prerequisite in the source list, then it will not be installed. This doesn't sound very useful since you would be potentially listing hundreds of modules. However, this feature is mostly used in conjuncture with App::MechaCPAN::Deploy so that the modules listed in the cpanfile.snapshot
are the only module versions used.
update
If an older version of a given module is installed, a newer version will be installed. This is on by default.
Because to update is the default, the more useful option is false, or --no-update
from the command line. This will only install modules, not update modules to a newer version.
Note this option ONLY affects CPAN modules listed by package name, prerequisites and modules given not by package name are not affected by this option.
AUTHOR
Jon Gentle <cpan@atrodo.org>
COPYRIGHT
Copyright 2017- Jon Gentle
LICENSE
This is free software. You may redistribute copies of it under the terms of the Artistic License 2 as published by The Perl Foundation.