[Module-build-checkins] Module-Build/lib/Module/Build Base.pm,1.518,1.519
Status: Beta
Brought to you by:
kwilliams
From: Randy W. S. <si...@us...> - 2005-11-15 05:43:34
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21085/lib/Module/Build Modified Files: Base.pm Log Message: If the prerequisite type represents a conflict, label the table header to indicate that the expression in that column represents a clash when it is satisfied. Indicate failed prerequisites with a exclamation mark ("!") in the left column, before the module name. Reformat code to the two column indent standard used throughout Module::Build. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.518 retrieving revision 1.519 diff -u -d -r1.518 -r1.519 --- Base.pm 15 Nov 2005 01:50:26 -0000 1.518 +++ Base.pm 15 Nov 2005 05:43:27 -0000 1.519 @@ -1690,52 +1690,59 @@ } sub ACTION_prereq_report { - my $self = shift; - $self->log_info( $self->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 $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; - $output .= "\n$type:\n"; - my $mod_len = 2; - my $ver_len = 4; - my %mods; - while ( my ($modname, $spec) = each %$prereqs ) { - my $len = length $modname; - $mod_len = $len if $len > $mod_len; - $spec ||= '0'; - $len = length $spec; - $ver_len = $len if $len > $ver_len; - my $data = [ $modname => $spec ]; + my $output = ''; + foreach my $type (@types) { + my $prereqs = $info->{$type}; + next unless %$prereqs; + $output .= "\n$type:\n"; + my $mod_len = 2; + my $ver_len = 4; + my %mods; + while ( my ($modname, $spec) = each %$prereqs ) { + my $len = length $modname; + $mod_len = $len if $len > $mod_len; + $spec ||= '0'; + $len = length $spec; + $ver_len = $len if $len > $ver_len; - push @$data, $self->check_installed_status($modname, $spec)->{have}; - $mods{lc $modname} = $data; - } + my $mod = $self->check_installed_status($modname, $spec); + $mod->{name} = $modname; + $mod->{ok} ||= 0; + $mod->{ok} = ! $mod->{ok} if $type =~ /^(\w+_)?conflicts$/; - my $space = q{ } x ($mod_len - 3); - my $vspace = q{ } x ($ver_len - 3); - my $sline = q{-} x ($mod_len - 3); - my $vline = q{-} x ($ver_len - 3); - $output .= - " Module $space Need $vspace Have\n". - " ------$sline+------$vline-+----------\n"; + $mods{lc $modname} = $mod; + } - 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]); - $output .= - " $data->[0] $space $data->[1] $vspace $data->[2]\n"; - } + my $space = q{ } x ($mod_len - 3); + my $vspace = q{ } x ($ver_len - 3); + my $sline = q{-} x ($mod_len - 3); + my $vline = q{-} x ($ver_len - 3); + my $disposition = ($type =~ /^(\w+_)?conflicts$/) ? + 'Clash' : 'Need'; + $output .= + " Module $space $disposition $vspace Have\n". + " ------$sline+------$vline-+----------\n"; + + + for my $k (sort keys %mods) { + my $mod = $mods{$k}; + my $space = q{ } x ($mod_len - length $k); + my $vspace = q{ } x ($ver_len - length $mod->{need}); + my $f = $mod->{ok} ? ' ' : '!'; + $output .= + " $f $mod->{name} $space $mod->{need} $vspace $mod->{have}\n"; } - return $output; + } + return $output; } sub ACTION_help { |