summaryrefslogtreecommitdiff
path: root/runoff
diff options
context:
space:
mode:
authorrsc <rsc>2007-08-14 18:42:34 +0000
committerrsc <rsc>2007-08-14 18:42:34 +0000
commitf1f8dd91bc4e8b58972f17416b664f3a950092cd (patch)
tree51f81ac32e9ee78629d7843d2e1101b0a6c0b414 /runoff
parent29ff8d495c8cd67df6ee3830daea64eaa422756d (diff)
downloadxv6-labs-f1f8dd91bc4e8b58972f17416b664f3a950092cd.tar.gz
xv6-labs-f1f8dd91bc4e8b58972f17416b664f3a950092cd.tar.bz2
xv6-labs-f1f8dd91bc4e8b58972f17416b664f3a950092cd.zip
formatting
Diffstat (limited to 'runoff')
-rwxr-xr-xrunoff43
1 files changed, 43 insertions, 0 deletions
diff --git a/runoff b/runoff
index 919d837..092c8b6 100755
--- a/runoff
+++ b/runoff
@@ -35,6 +35,7 @@ pr -e8 -t runoff.list | awk '
close(f)
n=$1
printf("%02d %s\n", n/100, s);
+ printf("TOC: %04d %s\n", n, s) >"fmt/tocdata"
next
}
{
@@ -42,6 +43,48 @@ pr -e8 -t runoff.list | awk '
}' | pr -3 -t >>fmt/toc
cat toc.ftr >>fmt/toc
+# check for bad alignments
+perl -e '
+ while(<>){
+ chomp;
+ s!#.*!!;
+ s!\s+! !g;
+ s! +$!!;
+ next if /^$/;
+
+ if(/TOC: (\d+) (.*)/){
+ $toc{$2} = $1;
+ next;
+ }
+
+ if(/even: (.*)/){
+ $file = $1;
+ if(!defined($toc{$file})){
+ print STDERR "Have no toc for $file\n";
+ next;
+ }
+ if($toc{$file} =~ /^\d\d[^0]/){
+ print STDERR "$file does not start on a fresh page.\n";
+ }
+ next;
+ }
+
+ if(/odd: (.*)/){
+ $file = $1;
+ if(!defined($toc{$file})){
+ print STDERR "Have no toc for $file\n";
+ next;
+ }
+ if($toc{$file} =~ /^\d\d[^5]/){
+ print STDERR "$file does not start on a second half page.\n";
+ }
+ next;
+ }
+
+ print STDERR "Unknown spec: $_\n";
+ }
+' fmt/tocdata runoff.spec
+
# make definition list
cd fmt
perl -e '