view release on metacpan or search on metacpan
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
log => undef,
mirrors => [],
mirror_only => undef,
mirror_index => undef,
cpanmetadb => "http://cpanmetadb.plackperl.org/v1.0/",
perl => $^X,
argv => [],
local_lib => undef,
self_contained => undef,
exclude_vendor => undef,
prompt_timeout => 0,
prompt => undef,
configure_timeout => 60,
build_timeout => 3600,
test_timeout => 1800,
try_lwp => 1,
try_wget => 1,
try_curl => 1,
uninstall_shadows => ($] < 5.012),
skip_installed => 1,
skip_satisfied => 0,
static_install => 1,
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
'exclude-vendor!' => \$self->{exclude_vendor},
'mirror=s@' => $self->{mirrors},
'mirror-only!' => \$self->{mirror_only},
'mirror-index=s' => sub { $self->{mirror_index} = $self->maybe_abs($_[1]) },
'M|from=s' => sub {
$self->{mirrors} = [$_[1]];
$self->{mirror_only} = 1;
},
'cpanmetadb=s' => \$self->{cpanmetadb},
'cascade-search!' => \$self->{cascade_search},
'prompt!' => \$self->{prompt},
'installdeps' => \$self->{installdeps},
'skip-installed!' => \$self->{skip_installed},
'skip-satisfied!' => \$self->{skip_satisfied},
'reinstall' => sub { $self->{skip_installed} = 0 },
'interactive!' => \$self->{interactive},
'i|install' => sub { $self->{cmd} = 'install' },
'info' => sub { $self->{cmd} = 'info' },
'look' => sub { $self->{cmd} = 'look'; $self->{skip_installed} = 0 },
'U|uninstall' => sub { $self->{cmd} = 'uninstall' },
'self-upgrade' => sub { $self->{action} = 'self_upgrade' },
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
-f,--force force install
-n,--notest Do not run unit tests
--test-only Run tests only, do not install
-S,--sudo sudo to run install commands
--installdeps Only install dependencies
--showdeps Only display direct dependencies
--reinstall Reinstall the distribution even if you already have the latest version installed
--mirror Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)
--mirror-only Use the mirror's index file instead of the CPAN Meta DB
-M,--from Use only this mirror base URL and its index file
--prompt Prompt when configure/build/test fails
-l,--local-lib Specify the install base to install modules
-L,--local-lib-contained Specify the install base to install all non-core modules
--self-contained Install all non-core modules, even if they're already installed.
--auto-cleanup Number of days that cpanm's work directories expire in. Defaults to 7
Commands:
--self-upgrade upgrades itself
--info Displays distribution info on CPAN
--look Opens the distribution with your SHELL
-U,--uninstall Uninstalls the modules (EXPERIMENTAL)
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
cpanm ~/dists/MyCompany-Enterprise-1.00.tar.gz # install from a local file
cpanm --interactive Task::Kensho # Configure interactively
cpanm . # install from local directory
cpanm --installdeps . # install all the deps for the current directory
cpanm -L extlib Plack # install Plack and all non-core deps into extlib
cpanm --mirror http://cpan.cpantesters.org/ DBI # use the fast-syncing mirror
cpanm -M https://cpan.metacpan.org App::perlbrew # use only this secure mirror and its index
You can also specify the default options in PERL_CPANM_OPT environment variable in the shell rc:
export PERL_CPANM_OPT="--prompt --reinstall -l ~/perl --mirror http://cpan.cpantesters.org"
Type `man cpanm` or `perldoc cpanm` for the more detailed explanation of the options.
HELP
return 1;
}
sub _writable {
my $dir = shift;
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
local::lib->install_base_arch_path($base),
local::lib->install_base_perl_path($base),
@INC,
];
}
$self->_setup_local_lib_env($base) unless $no_env;
$self->{local_lib} = $base;
}
}
sub prompt_bool {
my($self, $mess, $def) = @_;
my $val = $self->prompt($mess, $def);
return lc $val eq 'y';
}
sub prompt {
my($self, $mess, $def) = @_;
my $isa_tty = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ;
my $dispdef = defined $def ? "[$def] " : " ";
$def = defined $def ? $def : "";
if (!$self->{prompt} || (!$isa_tty && eof STDIN)) {
return $def;
}
local $|=1;
local $\;
my $ans;
eval {
local $SIG{ALRM} = sub { undef $ans; die "alarm\n" };
print STDOUT "$mess $dispdef";
alarm $self->{prompt_timeout} if $self->{prompt_timeout};
$ans = <STDIN>;
alarm 0;
};
if ( defined $ans ) {
chomp $ans;
} else { # user hit ctrl-D or alarm timeout
print STDOUT "\n";
}
return (!defined $ans || $ans eq '') ? $def : $ans;
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
my($self, $cmd, $distname, $dist, $depth) = @_;
local $ENV{PERL_MM_USE_DEFAULT} = !$self->{interactive};
local $ENV{PERL_USE_UNSAFE_INC} = $self->_use_unsafe_inc($dist);
$cmd = $self->append_args($cmd, 'build') if $depth == 0;
return 1 if $self->run_timeout($cmd, $self->{build_timeout});
while (1) {
my $ans = lc $self->prompt("Building $distname failed.\nYou can s)kip, r)etry, e)xamine build log, or l)ook ?", "s");
return if $ans eq 's';
return $self->build($cmd, $distname, $dist, $depth) if $ans eq 'r';
$self->show_build_log if $ans eq 'e';
$self->look if $ans eq 'l';
}
}
sub test {
my($self, $cmd, $distname, $dist, $depth) = @_;
return 1 if $self->{notest};
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
$cmd = $self->append_args($cmd, 'test') if $depth == 0;
return 1 if $self->run_timeout($cmd, $self->{test_timeout});
if ($self->{force}) {
$self->diag_fail("Testing $distname failed but installing it anyway.");
return 1;
} else {
$self->diag_fail;
while (1) {
my $ans = lc $self->prompt("Testing $distname failed.\nYou can s)kip, r)etry, f)orce install, e)xamine build log, or l)ook ?", "s");
return if $ans eq 's';
return $self->test($cmd, $distname, $dist, $depth) if $ans eq 'r';
return 1 if $ans eq 'f';
$self->show_build_log if $ans eq 'e';
$self->look if $ans eq 'l';
}
}
}
sub install {
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
sub ask_permission {
my ($self, $module, $files) = @_;
$self->diag("$module contains the following files:\n\n");
for my $file (@$files) {
$self->diag(" $file\n");
}
$self->diag("\n");
return 'force uninstall' if $self->{force};
local $self->{prompt} = 1;
return $self->prompt_bool("Are you sure you want to uninstall $module?", 'y');
}
sub unpack_packlist {
my ($self, $packlist) = @_;
open my $fh, '<', $packlist or die "$packlist: $!";
map { chomp; $_ } <$fh>;
}
sub uninstall_files {
my ($self, @files) = @_;
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
my $ret = CPAN::Meta::Check::check_requirements($reqs, 'requires', $self->{search_inc});
grep defined, values %$ret;
}
sub install_deps_bailout {
my($self, $target, $dir, $depth, @deps) = @_;
my($ok, $fail) = $self->install_deps($dir, $depth, @deps);
if (!$ok) {
$self->diag_fail("Installing the dependencies failed: " . join(", ", @$fail), 1);
unless ($self->prompt_bool("Do you want to continue building $target anyway?", "n")) {
$self->diag_fail("Bailing out the installation for $target.", 1);
return;
}
}
return 1;
}
sub build_stuff {
my($self, $stuff, $dist, $depth) = @_;
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
}
};
for my $try ($try_static, $try_mb, $try_eumm) {
$try->();
last if $state->{configured_ok};
}
unless ($state->{configured_ok}) {
while (1) {
my $ans = lc $self->prompt("Configuring $dist->{dist} failed.\nYou can s)kip, r)etry, e)xamine build log, or l)ook ?", "s");
last if $ans eq 's';
return $self->configure_this($dist, $depth) if $ans eq 'r';
$self->show_build_log if $ans eq 'e';
$self->look if $ans eq 'l';
}
}
return $state;
}
devdata/Menlo-CLI-Compat.v1.9022.pm.txt view on Meta::CPAN
my @missing;
for my $module (keys %$reqs) {
if ($self->should_install($module, $req->{$module})) {
push @missing, $module;
}
}
if (@missing) {
my $howmany = @missing;
$self->diag("==> Found missing dependencies: " . join(", ", @missing) . "\n", 1);
local $self->{prompt} = 1;
return $self->prompt_bool("Install the $howmany optional module(s)?", "y");
}
}
return;
}
sub find_prereqs {
my($self, $dist) = @_;
my @deps = $self->extract_meta_prereqs($dist);
lib/App/ShellCompleter/cpanm.pm view on Meta::CPAN
'l|local-lib=s' => $noop,
'L|local-lib-contained=s' => $noop,
'self-contained!' => $noop,
'exclude-vendor!' => $noop,
'mirror=s@' => $noop,
'mirror-only!' => $noop,
'mirror-index=s' => $noop,
'M|from=s' => $noop, # url (this is --mirror and --mirror-only combined)
'cpanmetadb=s' => $noop,
'cascade-search!' => $noop,
'prompt!' => $noop,
'installdeps' => $noop,
'skip-installed!' => $noop,
'skip-satisfied!' => $noop,
'reinstall' => $noop,
'interactive!' => $noop,
'i|install' => $noop,
'info' => $noop,
'look' => $noop,
'U|uninstall' => $noop,
'self-upgrade' => $noop,