BEGIN {
use vars qw[ $VERSION @ISA ];
@ISA = qw[ CPANPLUS::Shell::_Base::ReadLine ];
- $VERSION = "0.84";
+ $VERSION = "0.86_06";
}
load CPANPLUS::Shell;
$cb->_flush( list => [qw|lib load|] );
} continue {
+ ### clear the sigint count
$self->_signals->{INT}{count}--
- if $self->_signals->{INT}{count}; # clear the sigint count
+ if $self->_signals->{INT}{count};
+
+ ### reset the 'install prereq?' cached answer
+ $self->settings->{'install_all_prereqs'} = undef;
+
}
return 1;
sub _format_version {
my $self = shift;
- my $version = shift;
+ my $version = shift || 0;
### fudge $version into the 'optimal' format
$version = 0 if $version eq 'undef';
$Shell->__print( loc("Module '%1' requires '%2' to be installed",
$mod->module, $prereq->module ) );
$Shell->__print( "\n\n" );
+
+ ### previously cached answer?
+ return $Shell->settings->{'install_all_prereqs'}
+ if defined $Shell->settings->{'install_all_prereqs'};
+
+
$Shell->__print(
loc( "If you don't wish to see this question anymore\n".
"you can disable it by entering the following ".
's conf prereqs 1; s save' ) );
$Shell->__print("\n\n");
- my $bool = $term->ask_yn(
+ my $yes = loc("Yes");
+ my $no = loc("No");
+ my $all = loc("Yes to all (for this module)");
+ my $none = loc("No to all (for this module)");
+
+ my $reply = $term->get_reply(
prompt => loc("Should I install this module?"),
- default => 'y'
+ choices => [ $yes, $no, $all, $none ],
+ default => $yes,
);
- return $bool;
+ ### if 'all' or 'none', save this, so we can apply it to
+ ### other prereqs in this chain.
+ $Shell->settings->{'install_all_prereqs'} =
+ $reply eq $all ? 1 :
+ $reply eq $none ? 0 :
+ undef;
+
+ ### if 'yes' or 'all', the user wants it installed
+ return $reply eq $all ? 1 :
+ $reply eq $yes ? 1 :
+ 0;
}
sub __ask_about_send_test_report {
$self->_pager_open if scalar @$mods * 10 > $self->_term_rowcount;
- my $format = "%-30s %-30s\n";
+ my $format = "%-24s %-45s\n";
+ my $cformat = "%-24s %-45s %-10s\n";
for my $mod (@$mods) {
my $href = $mod->details( %$opts );
my @list = sort { $a->module cmp $b->module } $mod->contains;
my $showed;
for my $item ( @list ) {
$self->__printf(
- $format, ($showed ? '' : 'Contains:'), $item->module
+ $cformat, ($showed ? '' : 'Contains:'),
+ $item->module, $item->version
);
$showed++;
}
boxed => CONFIG_BOXED,
}->{ $key } || CONFIG_USER;
- ### boxed is special, so let's get it's value from %INC
+ ### boxed is special, so let's get its value from %INC
### so we can tell it where to save
### XXX perhaps this logic should be generic for all
### types, and put in the ->save() routine
user => CONFIG_USER,
system => CONFIG_SYSTEM,
}->{ $key } || CONFIG_USER;
-
+
my $file = $conf->_config_pm_to_file( $where );
system("$editor $file");
### now reload it
### disable warnings for this
{ require Module::Loaded;
- Module::Loaded::mark_as_unloaded( $_ ) for $conf->configs;
+ Module::Loaded::mark_as_unloaded( $where );
### reinitialize the config
local $^W;
$i++;
$self->__print( "\t[$i] $uri\n" );
}
+
+ $self->__print(
+ loc("\nTo edit this list, please type: '%1'\n", 's edit') );
} elsif ( $type eq 'selfupdate' ) {
my %valid = map { $_ => $_ }
$self->__printf( " $format\n", $name, $val );
}
- } elsif ( $key eq 'hosts' ) {
+ } elsif ( $key eq 'hosts' or $key eq 'lib' ) {
$self->__print(
- loc( "Setting hosts is not trivial.\n" .
- "It is suggested you use '%1' and edit the " .
- "configuration file manually", 's edit')
+ loc( "Setting %1 is not trivial.\n" .
+ "It is suggested you use '%2' and edit the " .
+ "configuration file manually", $key, 's edit')
);
} else {
my $method = 'set_' . $type;
}
}
- ### dispatch a plugin command to it's function
+ ### dispatch a plugin command to its function
sub _meta {
my $self = shift;
my %hash = @_;
my $who = $pkg eq $this
? "Standard Plugin"
- : do { $pkg =~ s/^$this/../; "Provided by: $pkg" };
+ : do { my $v = $self->_format_version($pkg->VERSION) || '';
+ $pkg =~ s/^$this/../;
+ sprintf "Provided by: %-30s %-10s", $pkg, $v;
+ };
$self->__printf( $help_format, $name, $who );
}
loc( "You can run an interactive setup using '%1'", 's reconfigure' ),
loc( "You can add custom sources to your index. See '%1' for details",
'/cs --help' ),
+ loc( "CPANPLUS now has an experimental SQLite backend. You can enable ".
+ "it via: '%1'. Update dependencies via '%2'",
+ 's conf source_engine CPANPLUS::Internals::Source::SQLite; s save',
+ 's selfupdate enabled_features ' ),
);
sub _show_random_tip {