Created
December 27, 2012 07:18
-
-
Save tmitz/4386265 to your computer and use it in GitHub Desktop.
download-onlyオプション追加したcpanmにするパッチ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- cpanm 2012-12-27 16:00:28.000000000 +0900 | |
| *************** $fatpacked{"App/cpanminus/script.pm"} = | |
| *** 418,423 **** | |
| --- 418,424 ---- | |
| 'i|install' => sub { $self->{cmd} = 'install' }, | |
| 'info' => sub { $self->{cmd} = 'info' }, | |
| 'look' => sub { $self->{cmd} = 'look'; $self->{skip_installed} = 0 }, | |
| + 'download-only!' => \$self->{download_only}, | |
| 'self-upgrade' => sub { $self->check_upgrade; $self->{cmd} = 'install'; $self->{skip_installed} = 1; push @ARGV, 'App::cpanminus' }, | |
| 'uninst-shadows!' => \$self->{uninstall_shadows}, | |
| 'lwp!' => \$self->{try_lwp}, | |
| *************** $fatpacked{"App/cpanminus/script.pm"} = | |
| *** 1624,1629 **** | |
| --- 1625,1643 ---- | |
| $self->install_deps_bailout($distname, $dist->{dir}, $depth, @deps) | |
| or return; | |
| + | |
| + if ($self->{download_only} && $self->{local_lib}) { | |
| + my $download_lib; | |
| + if (my $filename = $dist->{pathname}) { | |
| + $download_lib = File::Spec->catfile($self->{local_lib}, 'authors', 'id', $filename); | |
| + File::Path::mkpath(File::Basename::dirname($download_lib)); | |
| + } else { | |
| + $download_lib = File::Spec->catfile($download_lib, File::Basename::basename($dist->{local_path})); | |
| + } | |
| + File::Copy::copy($dist->{local_path}, $download_lib); | |
| + $self->diag("Copy to $download_lib\n"); | |
| + return 1; | |
| + } | |
| if ($self->{scandeps}) { | |
| unless ($configure_state->{configured_ok}) { |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使い方
cpanm -L /tmp/hogehoge --download-only Foo::Bar