use strict;
use vars qw(%can %keys $loading $VERSION);
-$VERSION = sprintf "%.6f", substr(q$Rev: 2212 $,4)/1000000 + 5.4;
+$VERSION = "5.5";
%can = (
commit => "Commit changes to disk",
# Q: where is the "How do I add a new config option" HOWTO?
# A1: svn diff -r 757:758 # where dagolden added test_report
# A2: svn diff -r 985:986 # where andk added yaml_module
+# A3: 1. add new config option to %keys below
+# 2. add a Pod description in CPAN::FirstTime; it should include a
+# prompt line; see others for examples
+# 3. add a "matcher" section in CPAN::FirstTime::init that includes
+# a prompt function; see others for examples
+# 4. add config option to documentation section in CPAN.pm
+
%keys = map { $_ => undef }
(
"applypatch",
"colorize_warn",
"commandnumber_in_prompt",
"commands_quote",
+ "connect_to_internet_ok",
"cpan_home",
"curl",
"dontload_hash", # deprecated after 1.83_68 (rev. 581)
"ftp",
"ftp_passive",
"ftp_proxy",
+ "ftpstats_size",
+ "ftpstats_period",
"getcwd",
"gpg",
"gzip",
+ "halt_on_failure",
"histfile",
"histsize",
"http_proxy",
"pager",
"password",
"patch",
+ "patches_dir",
+ "perl5lib_verbosity",
"prefer_installer",
"prefs_dir",
"prerequisites_policy",
"term_is_latin",
"term_ornaments",
"test_report",
+ "trust_test_report_history",
"unzip",
"urllist",
"use_sqlite",
"test_report",
);
-if ($^O eq "MSWin32") {
- for my $k (qw(
- mbuild_install_build_command
- make_install_make_command
- )) {
- delete $keys{$k};
- if (exists $CPAN::Config->{$k}) {
- for ("deleting previously set config variable '$k' => '$CPAN::Config->{$k}'") {
- $CPAN::Frontend ? $CPAN::Frontend->mywarn($_) : warn $_;
- }
- delete $CPAN::Config->{$k};
- }
- }
-}
-
# returns true on successful action
sub edit {
my($self,@args) = @_;
CPAN->debug("self[$self]args[".join(" | ",@args)."]");
my($o,$str,$func,$args,$key_exists);
$o = shift @args;
- $DB::single = 1;
if($can{$o}) {
$self->$o(args => \@args); # o conf init => sub init => sub load
return 1;
}
my $msg;
+ my $home = home();
$msg = <<EOF unless $configpm =~ /MyConfig/;
# This is CPAN.pm's systemwide configuration file. This file provides
# defaults for users, and the values can be changed in a per-user
# configuration file. The user-config file is being looked for as
-# ~/.cpan/CPAN/MyConfig.pm.
+# $home/.cpan/CPAN/MyConfig.pm.
EOF
$msg ||= "\n";
sub home () {
my $home;
+ # Suppress load messages until we load the config and know whether
+ # load messages are desired. Otherwise, it's unexpected and odd
+ # why one load message pops up even when verbosity is turned off.
+ # This means File::HomeDir load messages are never seen, but I
+ # think that's probably OK -- DAGOLDEN
+
+ # 5.6.2 seemed to segfault localizing a value in a hashref
+ # so do it manually instead
+ my $old_v = $CPAN::Config->{load_module_verbosity};
+ $CPAN::Config->{load_module_verbosity} = q[none];
if ($CPAN::META->has_usable("File::HomeDir")) {
- $home = File::HomeDir->my_data;
+ $home = File::HomeDir->can('my_dot_config')
+ ? File::HomeDir->my_dot_config
+ : File::HomeDir->my_data;
unless (defined $home) {
$home = File::HomeDir->my_home
}
unless (defined $home) {
$home = $ENV{HOME};
}
+ $CPAN::Config->{load_module_verbosity} = $old_v;
$home;
}
use Carp;
require_myconfig_or_config;
my @miss = $self->missing_config_data;
+ CPAN->debug("doit[$doit]loading[$loading]miss[@miss]") if $CPAN::DEBUG;
return unless $doit || @miss;
return if $loading;
$loading++;
"makepl_arg",
"mbuild_arg",
"mbuild_install_arg",
- "mbuild_install_build_command",
+ ($^O eq "MSWin32" ? "" : "mbuild_install_build_command"),
"mbuildpl_arg",
"no_proxy",
#"pager",
use strict;
use vars qw($AUTOLOAD $VERSION);
- $VERSION = sprintf "%.2f", substr(q$Rev: 2212 $,4)/100;
+ $VERSION = "5.5";
# formerly CPAN::HandleConfig was known as CPAN::Config
- sub AUTOLOAD {
+ sub AUTOLOAD { ## no critic
my $class = shift; # e.g. in dh-make-perl: CPAN::Config
my($l) = $AUTOLOAD;
$CPAN::Frontend->mywarn("Dispatching deprecated method '$l' to CPAN::HandleConfig\n");