Update: I've since discovered that I prefer cpanm
Using your code as a starter, here is what I'm using. I think it's a bit simpler not having to rewrite the FirstTime.pm file: ########################################
# Get CPAN::Config.pm initialized
export PERL_MM_USE_DEFAULT=1 PERL_MM_NONINTERACTIVE=1 AUTOMATED_TESTIN
+G=1
perl <<'EOT' || exit
use strict;
use Data::Dumper;
# get the path to the library
use Config;
my $libpath = $Config{privlib};
# force CPAN::FirstTime to not default to manual
# setup, since initial CPAN setup needs to be automated
{
local @ARGV = "$libpath/CPAN/FirstTime.pm";
my @source = <>;
$source[72] =~ s/\byes\b/no/ or die "Could not auto configure CPAN";
eval join('', @source) or die "Error executing CPAN::FirstTime: $@";
}
CPAN::FirstTime::init("$libpath/CPAN/Config.pm");
delete $CPAN::Config->{links};
$CPAN::Config->{auto_commit} = '0';
$CPAN::Config->{check_sigs} = '0';
$CPAN::Config->{halt_on_failure} = '0';
$CPAN::Config->{make_install_make_command} = '/usr/bin/make';
$CPAN::Config->{mbuild_arg} = '';
$CPAN::Config->{mbuildpl_arg} = '';
$CPAN::Config->{mbuild_install_arg} = '';
$CPAN::Config->{show_upload_date} = '';
$CPAN::Config->{tar_verbosity} = '1';
$CPAN::Config->{trust_test_report_history} = '0';
$CPAN::Config->{use_sqlite} = '0';
$CPAN::Config->{yaml_load_code} = '0';
$CPAN::Config->{urllist}
= [q[ftp:...your list.../], q[http://...your list...]];
$CPAN::Config->{connect_to_internet_ok} = '1';
$CPAN::Config->{perl5lib_verbosity} = 'v';
$CPAN::Config->{prefer_installer} = 'MB';
$CPAN::Config->{build_requires_install_policy} = 'no';
$CPAN::Config->{term_ornaments} = '1';
$CPAN::Config->{mbuild_install_build_command} = './Build';
mkdir ".cpan/CPAN" or die "Can't create .cpan/CPAN: $!";
CPAN::Config->commit(".cpan/CPAN/MyConfig.pm");
CPAN::install('Bundle::CPAN');
#CPAN::force('install', '');
CPAN::install('JSON');
CPAN::install('JSON::XS');
exit 0;
EOT
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|