Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 55 lines (45 sloc) 1.421 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
# -*- cperl -*-
eval 'exec $CBROOT/bin/perl -w $0 ${1+"$@"}'
  if my $running_under_some_shell;
use strict;
use warnings;
use File::Path qw(mkpath);
use Config;

my $root = $ENV{CBROOTLOCAL} or die "Need CBROOTLOCAL\n";
my $base = $root . q[/cpan];

my $arch_dir = $base . "/lib/perl5/" . $Config::Config{archname};
unless (-d $arch_dir) {
  mkpath($arch_dir) || die "Cannot create $arch_dir: $!\n";
  # Restart ourselves to get PERL5LIB setup
  exec($0,@ARGV);
}

die "$base does not exists" unless -d $base;

use CPAN 1.9205;
require CPAN::MyConfig;
require CPAN::FirstTime;

$CPAN::Config->{makepl_arg} = q[INSTALL_BASE=] . $base . q[ INSTALLBASE=] . $base;
$CPAN::Config->{mbuildpl_arg} = q[--install_base ] . $base;

my $local_mirror = "$ENV{HOME}/src/cpan/mirror/";
$local_mirror = undef unless -d $local_mirror;
$local_mirror = $local_mirror && "file://$local_mirror";

# Should get this from config
$CPAN::Config->{urllist} = [
                         ($local_mirror ? ($local_mirror) : ()),
                         'http://cpan.develooper.com',
                         'ftp://mirrors.kernel.org/pub/CPAN',
                         'http://cpan.mirrorgeek.com'
                       ];

CPAN::FirstTime::init("/dev/null",
  autoconfig => 1,
);
eval {
  require Data::Dumper;
  warn Data::Dumper::Dumper($CPAN::Config);
};
require CPAN;

if (@ARGV) {
    CPAN::install(@ARGV);
}
else {
    CPAN::shell();
}
Something went wrong with that request. Please try again.