summaryrefslogtreecommitdiff
path: root/Build/source/doc/splitinfo.gawk
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-04-21 22:33:25 +0000
committerKarl Berry <karl@freefriends.org>2014-04-21 22:33:25 +0000
commitd67cd9824523dc725b1cdf9229c38dfa69812e65 (patch)
tree5f25519b02159d2bc57f2003479fe2712951fad8 /Build/source/doc/splitinfo.gawk
parent447bcd45d972526c26cc8436a8096a7898160bbd (diff)
renname whole document to tlbuild rather than texlive, since that is what it describes
git-svn-id: svn://tug.org/texlive/trunk@33604 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/doc/splitinfo.gawk')
-rw-r--r--Build/source/doc/splitinfo.gawk24
1 files changed, 13 insertions, 11 deletions
diff --git a/Build/source/doc/splitinfo.gawk b/Build/source/doc/splitinfo.gawk
index dd1133fafb4..143b247e038 100644
--- a/Build/source/doc/splitinfo.gawk
+++ b/Build/source/doc/splitinfo.gawk
@@ -9,24 +9,26 @@ BEGIN {
}
{
- if (/^[*=]+$/) { # starting new chapter or section
+ if (/^[*]+$/) { # starting new chapter
# if we're at the index, quit.
if (lastline == "Index") exit (0);
- # otherwise ignore unless chapter 2 (don't care about top, index, etc.)
- if (lastline !~ /^2/) next;
+ # move on unless starting a chapter we want (not top, intro, etc.)
+ if (lastline !~ /^[2-9]/) next;
- # ok, we want this. if we had a file open already, close it.
+ # ok, we want this chapter. if we had a file open already, close it.
if (outfile) close (outfile);
- # turn section title into filename and start new.
+ # turn chapter title into filename and start new.
outfile = tolower (lastline); # all lowercase
- sub ("^2 ", "2.0 overview ", outfile); # consider beginning of chapter as 2.0
- sub ("^2\\.", "", outfile); # remove "2."
- sub (" ", "", outfile); # remove first space (after secnum)
- sub (" .*", "", outfile); # remove space and everything after,
- # leaving just the first word.
- outfile = "README." outfile; # prefix "README.
+ chapnum = substr (outfile, 0, 1); # chapter number
+ sub ("^. ", "", outfile); # remove chapnum and following space
+ sub (" .*", "", outfile); # remove next space and everything
+ # after, leaving just the first word.
+
+ # start numbering the README files at 0.
+ chapnum = chapnum - 2;
+ outfile = "README." chapnum outfile; # prefix "README.
#
print "(This file was generated by makeinfo and splitinfo.gawk.)">outfile;
print "(Released under the old-style GNU documentation license;" >outfile;