[Module-build-checkins] Module-Build/lib/Module/Build Authoring.pod,1.19,1.20 Base.pm,1.513,1.514
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <kwi...@us...> - 2005-11-13 03:26:58
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19403/lib/Module/Build Modified Files: Authoring.pod Base.pm Log Message: Add a prereq_report() method that implements the guts of the prereq_report action Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.513 retrieving revision 1.514 diff -u -d -r1.513 -r1.514 --- Base.pm 13 Nov 2005 03:17:44 -0000 1.513 +++ Base.pm 13 Nov 2005 03:26:51 -0000 1.514 @@ -1688,13 +1688,19 @@ sub ACTION_prereq_report { my $self = shift; + $self->log_info( $self->prereq_report ); +} + +sub prereq_report { + my $self = shift; my @types = @{ $self->prereq_action_types }; my $info = { map { $_ => $self->$_() } @types }; + my $output = ''; foreach my $type (@types) { my $prereqs = $info->{$type}; next unless %$prereqs; - $self->log_info("\n$type:\n"); + $output .= "\n$type:\n"; my $mod_len = 2; my $ver_len = 4; my %mods; @@ -1715,20 +1721,19 @@ my $vspace = q{ } x ($ver_len - 3); my $sline = q{-} x ($mod_len - 3); my $vline = q{-} x ($ver_len - 3); - $self->log_info( - " Module $space Need $vspace Have\n", - " ------$sline+------$vline-+----------\n", - ); + $output .= + " Module $space Need $vspace Have\n". + " ------$sline+------$vline-+----------\n"; for my $k (sort keys %mods) { my $data = $mods{$k}; my $space = q{ } x ($mod_len - length $k); my $vspace = q{ } x ($ver_len - length $data->[1]); - $self->log_info( - " $data->[0] $space $data->[1] $vspace $data->[2]\n" - ); + $output .= + " $data->[0] $space $data->[1] $vspace $data->[2]\n"; } } + return $output; } sub ACTION_help { Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Authoring.pod 5 Nov 2005 15:48:55 -0000 1.19 +++ Authoring.pod 13 Nov 2005 03:26:51 -0000 1.20 @@ -1177,6 +1177,15 @@ } } +=item prereq_report() + +Returns a human-readable (table-form) string showing all +prerequisites, the versions required, and the versions actually +installed. This can be useful for reviewing the configuration of your +system prior to a build, or when compiling data to send for a bug +report. The C<prereq_report> action is just a thin wrapper around the +C<prereq_report()> method. + =item prompt($message, $default) Asks the user a question and returns their response as a string. The |