2010-10-02 10:33:33 +02:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
my $errorMsg;
|
|
|
|
|
|
|
|
foreach my $module (qw(common handler manager portal)) {
|
|
|
|
open CMD,
|
|
|
|
"find lemonldap-ng-$module/lib/Lemonldap/NG -type f -name '*.pm'|";
|
|
|
|
my @files;
|
|
|
|
while (<CMD>) {
|
|
|
|
chomp;
|
|
|
|
push @files, $_;
|
|
|
|
}
|
|
|
|
close CMD;
|
|
|
|
|
2010-12-05 17:57:22 +01:00
|
|
|
#my @files = qw(lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthChoice.pm);
|
2010-10-02 10:33:33 +02:00
|
|
|
foreach my $file (@files) {
|
|
|
|
open F, $file;
|
|
|
|
$file =~ s#.*/NG/##;
|
2010-10-03 10:25:40 +02:00
|
|
|
$_ = <F>;
|
2010-12-05 17:57:22 +01:00
|
|
|
unless (/^##\s*\@file/) {
|
2010-10-03 10:25:40 +02:00
|
|
|
push @{ $errorMsg->{$module}->{undocumented} }, $file;
|
|
|
|
next;
|
|
|
|
}
|
2010-10-02 10:33:33 +02:00
|
|
|
my $autoload = 0;
|
|
|
|
while (<F>) {
|
|
|
|
next if /^(?:\s*#|\*lmLog|sub lmLog)/;
|
|
|
|
$autoload = 1 if (/use\s+AutoLoader/);
|
|
|
|
last if ( /^__END__$/ and not $autoload );
|
2010-10-13 22:32:01 +02:00
|
|
|
next unless (/abort|lmLog|STDERR/);
|
2010-10-02 10:33:33 +02:00
|
|
|
if (/lmLog/) {
|
|
|
|
$_ .= <F> while ( !/[\)\}];/s );
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$_ .= <F> while ( !/(?:\s+if\s*\()?;$/ );
|
|
|
|
}
|
|
|
|
$_ =~ s/\n//gs;
|
|
|
|
my ( $msg, $level );
|
|
|
|
if (/lmLog/) {
|
|
|
|
/lmLog\s*\(\s*(.+?)\s*,\s*(['"])(info|notice|warn|error)\2/s
|
|
|
|
or next;
|
|
|
|
( $msg, $level ) = ( $1, $3 );
|
|
|
|
}
|
2010-12-05 17:57:22 +01:00
|
|
|
elsif (/abort/) {
|
|
|
|
/abort\s*\(\s*(.+?)\s*(?:,\s*(.+?)\s*)?\)/s or next;
|
|
|
|
( $msg, $level ) = ( "$1 ($2)", 'abort' );
|
|
|
|
}
|
2010-10-02 10:33:33 +02:00
|
|
|
else {
|
|
|
|
$level = 'error';
|
|
|
|
/STDERR\s+(.*)(?:\s+if\s*\()?;$/ or next;
|
|
|
|
$msg = $1;
|
|
|
|
}
|
|
|
|
push @{ $errorMsg->{$module}->{$level} }, $msg;
|
|
|
|
}
|
|
|
|
close F;
|
|
|
|
}
|
|
|
|
print "\n###### " . uc($module) . " ######\n";
|
2010-10-03 10:25:40 +02:00
|
|
|
foreach ( @{ $errorMsg->{$module}->{undocumented} } ) {
|
2010-12-05 17:57:22 +01:00
|
|
|
print "## No Doxygen ## $_\n";
|
2010-10-03 10:25:40 +02:00
|
|
|
}
|
2010-10-13 22:32:01 +02:00
|
|
|
foreach my $level (qw(abort error warn notice info)) {
|
2010-12-05 17:57:22 +01:00
|
|
|
my $last = '';
|
|
|
|
next unless ( ref( $errorMsg->{$module}->{$level} ) );
|
|
|
|
foreach ( sort ( @{ $errorMsg->{$module}->{$level} } ) ) {
|
|
|
|
print "[$level] $_\n" unless ( $_ eq $last );
|
|
|
|
$last = $_;
|
2010-10-02 10:33:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|