use strict;
use vars qw(%can %keys $VERSION);
-$VERSION = sprintf "%.6f", substr(q$Rev: 1379 $,4)/1000000 + 5.4;
+$VERSION = sprintf "%.6f", substr(q$Rev: 1566 $,4)/1000000 + 5.4;
%can = (
commit => "Commit changes to disk",
# A2: svn diff -r 985:986 # where andk added yaml_module
%keys = map { $_ => undef }
(
+ "applypatch",
+ "auto_commit",
"build_cache",
"build_dir",
"build_dir_reuse",
"bzip2",
"cache_metadata",
"check_sigs",
+ "colorize_debug",
"colorize_output",
"colorize_print",
"colorize_warn",
unless (exists $keys{$o}) {
$CPAN::Frontend->mywarn("Warning: unknown configuration variable '$o'\n");
}
+ my $changed;
+
+
# one day I used randomize_urllist for a boolean, so we must
# list them explicitly --ak
- if ($o =~ /^(wait_list|urllist|dontload_list)$/) {
+ if (0) {
+ } elsif ($o =~ /^(wait_list|urllist|dontload_list)$/) {
+
+ #
+ # ARRAYS
+ #
+
$func = shift @args;
$func ||= "";
CPAN->debug("func[$func]args[@args]") if $CPAN::DEBUG;
- my $changed;
# Let's avoid eval, it's easier to comprehend without.
if ($func eq "push") {
push @{$CPAN::Config->{$o}}, @args;
$self->prettyprint($o);
}
if ($changed) {
- $CPAN::CONFIG_DIRTY = 1;
if ($o eq "urllist") {
# reset the cached values
undef $CPAN::FTP::Thesite;
undef $CPAN::FTP::Themethod;
+ $CPAN::Index::LAST_TIME = 0;
} elsif ($o eq "dontload_list") {
# empty it, it will be built up again
$CPAN::META->{dontload_hash} = {};
}
}
- return $changed;
} elsif ($o =~ /_hash$/) {
+
+ #
+ # HASHES
+ #
+
if (@args==1 && $args[0] eq ""){
@args = ();
} elsif (@args % 2) {
push @args, "";
}
$CPAN::Config->{$o} = { @args };
- $CPAN::CONFIG_DIRTY = 1;
+ $changed = 1;
} else {
+
+ #
+ # SCALARS
+ #
+
if (defined $args[0]){
$CPAN::CONFIG_DIRTY = 1;
$CPAN::Config->{$o} = $args[0];
+ $changed = 1;
}
$self->prettyprint($o)
if exists $keys{$o} or defined $CPAN::Config->{$o};
- return 1;
}
+ if ($changed) {
+ if ($CPAN::Config->{auto_commit}) {
+ $self->commit;
+ } else {
+ $CPAN::CONFIG_DIRTY = 1;
+ $CPAN::Frontend->myprint("Please use 'o conf commit' to ".
+ "make the config permanent!\n\n");
+ }
+ }
}
}
CPAN::FirstTime::init($configpm, %args);
}
+
+# returns mandatory but missing entries in the Config
sub missing_config_data {
my(@miss);
for (
+ "auto_commit",
"build_cache",
"build_dir",
"cache_metadata",
use strict;
use vars qw($AUTOLOAD $VERSION);
- $VERSION = sprintf "%.2f", substr(q$Rev: 1379 $,4)/100;
+ $VERSION = sprintf "%.2f", substr(q$Rev: 1566 $,4)/100;
# formerly CPAN::HandleConfig was known as CPAN::Config
sub AUTOLOAD {