]> git.ipfire.org Git - thirdparty/bash.git/blob - doc/mkinstall
initial fork from devel branch
[thirdparty/bash.git] / doc / mkinstall
1 #! /bin/sh
2 #
3 # mkinstall - make the INSTALL file from the `Installing Bash' node of the
4 # texinfo manual
5 #
6
7 NODE="Installing Bash"
8 SUBNODE="Basic Installation"
9 TEXI=bashref.texi
10 TMPINFO=temp.info
11 TMPOUT=INSTALL.tmp
12
13 OUT=${1:-INSTALL}
14
15 trap 'rm -f $TMPOUT $TMPINFO $OUT; trap '' 0; exit 1' 1 2 3 6 15
16 trap 'rm -f $TMPOUT $TMPINFO' 0
17
18 # create an info file without paragraph indentation
19 makeinfo --no-split --no-number-sections -I../lib/readline/doc --paragraph-indent 0 -o $TMPINFO $TEXI
20
21 # write out the text from the `Installing Bash' node to INSTALL.tmp
22 info --file $TMPINFO --node "$NODE" --subnodes --output $TMPOUT
23
24 # remove the info traversal information and the initial menu, and squeeze
25 # out multiple consecutive blank lines like `cat -s'
26 awk 'BEGIN { printline = 0; newlines = 0; }
27
28 /^File: '$TMPINFO'/ { next; }
29
30 /^'"$SUBNODE"'/ { printline = 1; }
31
32 /^$/ { if (printline) newlines = 1; next; }
33
34 /$/ { if (printline) {
35 if (newlines) {
36 printf "\n";
37 newlines = 0;
38 }
39 print $0;
40 }
41 }' < $TMPOUT > $OUT
42
43 exit 0