Created
November 10, 2010 13:39
-
-
Save kits/670853 to your computer and use it in GitHub Desktop.
myperlbrew.patch (use a favorite mirror site, instead of search.cpan.org)
This file contains 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
*** ./perlbrew 2010-11-05 08:56:08.156250000 +0900 | |
--- perl5/perlbrew/bin/perlbrew 2010-11-10 22:33:48.046875000 +0900 | |
*************** | |
*** 1116,1125 **** | |
unless ($dist_git_describe) { | |
my $mirror = $self->conf->{mirror}; | |
my $header = $mirror ? { 'Cookie' => "cpan=$mirror->{url}" } : undef; | |
! my $html = $self->_http_get("http://search.cpan.org/dist/$dist", undef, $header); | |
! ($dist_path, $dist_tarball) = | |
! $html =~ m[<a href="(/CPAN/authors/id/.+/(${dist}.tar.(gz|bz2)))">Download</a>]; | |
my $dist_tarball_path = "${ROOT}/dists/${dist_tarball}"; | |
if (-f $dist_tarball_path) { | |
--- 1116,1128 ---- | |
unless ($dist_git_describe) { | |
my $mirror = $self->conf->{mirror}; | |
my $header = $mirror ? { 'Cookie' => "cpan=$mirror->{url}" } : undef; | |
! my $my_mirror = $ENV{PERLBREW_MIRROR} || 'http://www.cpan.org'; | |
! my $html = $self->_http_get("$my_mirror/src/5.0/", undef, $header); | |
! ($dist_path) = | |
! $html =~ m{<a href="(${dist}.tar.(?:gz|bz2))">\1</a>}; | |
! $dist_path or die "$dist does not exist."; | |
! $dist_tarball = $dist_path; | |
my $dist_tarball_path = "${ROOT}/dists/${dist_tarball}"; | |
if (-f $dist_tarball_path) { | |
*************** | |
*** 1129,1135 **** | |
print "Fetching $dist as $dist_tarball_path\n"; | |
$self->_http_get( | |
! "http://search.cpan.org${dist_path}", | |
sub { | |
my ($body) = @_; | |
open my $BALL, "> $dist_tarball_path"; | |
--- 1132,1138 ---- | |
print "Fetching $dist as $dist_tarball_path\n"; | |
$self->_http_get( | |
! "$my_mirror/src/5.0/${dist_path}", | |
sub { | |
my ($body) = @_; | |
open my $BALL, "> $dist_tarball_path"; | |
*************** | |
*** 1203,1209 **** | |
$self->run_command_symlink_executables($as); | |
} | |
! $self->run_command_install_cpanm($as); | |
print <<SUCCESS; | |
Installed $dist as $as successfully. Run the following command to switch to it. | |
--- 1206,1212 ---- | |
$self->run_command_symlink_executables($as); | |
} | |
! #$self->run_command_install_cpanm($as); | |
print <<SUCCESS; | |
Installed $dist as $as successfully. Run the following command to switch to it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment