f8eb8c8679
Pipe the output of LaTeX through a Perl script and filter out information that is irrelevant in deciding if building the manual actually worked. Format errors in a similar way to gcc output to allow existing scripts catching it. Enabling verbose output during the make run will not remove parts of the output but only do some reflowing. The full log is always available in the manual subfolder. Change-Id: I15d35b4d3c73fafe2a4357168ca8ada51355f221 Reviewed-on: http://gerrit.rockbox.org/247 Reviewed-by: Dominik Riebeling <Dominik.Riebeling@gmail.com> Tested-by: Dominik Riebeling <Dominik.Riebeling@gmail.com>
62 lines
1.8 KiB
Perl
Executable file
62 lines
1.8 KiB
Perl
Executable file
#!/usr/bin/perl -s
|
|
#
|
|
# __________ __ ___.
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
# \/ \/ \/ \/ \/
|
|
#
|
|
|
|
my $verbose = $v;
|
|
my $reflowed = "";
|
|
my $last = "";
|
|
my $currentfile;
|
|
while(<STDIN>) {
|
|
chomp $_;
|
|
$reflowed .= $_;
|
|
if(/^.{79,}$/) {
|
|
# collapse all "full" lines
|
|
}
|
|
elsif(/^!/) {
|
|
# collapse lines indicating an error with next one and append a space.
|
|
$reflowed .= " ";
|
|
}
|
|
else {
|
|
# skip empty lines
|
|
if(length($reflowed) > 0) {
|
|
# collapse with previous line if it continues some "area".
|
|
if($reflowed =~ /^\s*(\]|\[|\\|\)|<)/) {
|
|
$last .= $reflowed;
|
|
}
|
|
else {
|
|
# find current input file
|
|
my @inputfile = $last =~ /\(([a-zA-Z_\-\/\.]+\.tex)/g;
|
|
foreach(@inputfile) {
|
|
if($verbose) {
|
|
print "\n";
|
|
}
|
|
print "LaTeX processing $_\n";
|
|
$currentfile = $_;
|
|
}
|
|
if($verbose) {
|
|
print $last;
|
|
}
|
|
# check for error
|
|
if($reflowed =~ /^!\s*(.*)/) {
|
|
my $l = $reflowed;
|
|
$l =~ s/^!\s*(.*)l.(\d+) /$2: $1/;
|
|
print "$currentfile:$l\n";
|
|
}
|
|
# restart for next reflowed line
|
|
$last = $reflowed;
|
|
}
|
|
}
|
|
# restart reflowing.
|
|
$reflowed = "";
|
|
}
|
|
}
|
|
if($verbose) {
|
|
print $last;
|
|
}
|
|
|