summaryrefslogtreecommitdiff
path: root/Docs/Support/test-make-manual-de
blob: a5c03001bda9174c03498ebdd65429d0eeee9ad8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/sh

needed_flags=0
needed_texi2html=0
needed_texinfo_tex=0
needed_include_texi=0

if [ -z $BROWSER ]; then
    BROWSER=netscape 
    echo "BROWSER not set, using $BROWSER"
fi

die ()
{
    echo
    echo $1
    cleanup
    exit 1
}

cleanup ()
{
    echo "Cleaning up..."
    if [ $needed_flags ]; then
        bk clean Flags
    fi

    if [ $needed_texi2html ]; then
        bk clean Support/texi2html
    fi

    if [ $needed_texinfo_tex ]; then
        bk clean Support/texinfo.tex
    fi

    if [ $needed_include_texi ]; then
        rm -f include.texi
    fi

    for file in \
        manual.de.aux manual.de.cp  manual.de.cps manual.de.dvi  \
        manual.de.fn  manual.de.fns manual.de.ky  manual.de.html \
        manual.de.pg  manual.de.toc manual.de.tp  manual.de.vr   \
        mysql.de.info manual.de_toc.html                   ;
    do
        rm -f $file
    done
        
}


if [ -e Flags/usa.txt ]; then
    echo "Good, Flags are there."
else
    echo -n "Checking out Flags..."
    bk edit Flags >/dev/null 2>&1
    echo " Done."
    needed_flags=1
fi

if [ -e Support/texi2html ]; then
    echo "Good, texi2html is there."
else
    echo -n "Checking out texi2html..."
    bk edit Support/texi2html >/dev/null 2>&1
    echo " Done."
    needed_texi2html=1
fi

if [ -e Support/texinfo.tex ]; then
    echo "Good, texinfo.tex is there."
else
    echo -n "Checking out texinfo.tex..."
    bk edit Support/texinfo.tex >/dev/null 2>&1
    echo " Done."
    needed_texinfo_tex=1
fi

if [ -e include.texi ]; then
    echo "Good, include.texi is there."
else
    echo -n "Creating include.texi..."
    bk edit ../configure.in >/dev/null 2>&1
    echo "@c This file was generated by test-make-manual" > include.texi
    echo -n "@set mysql_version " >> include.texi
    grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \
    sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> include.texi
    echo -n "@set default_port " >> include.texi
    grep "MYSQL_TCP_PORT_DEFAULT=" ../configure.in | \
    sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi
    echo " Done."
    needed_include_texi=1
fi

echo -n "Running makeinfo..."
makeinfo --no-split -I . manual.de.texi

if [ $? != 0 ]; then
    die "Manual has errors - fix before you commit"
else
    echo " Looks good."
fi


echo -n "Running texi2html..."
/usr/bin/perl ./Support/texi2html -iso -number manual.de.texi

if [ $? != 0 ]; then
    die "Manual has errors - fix before you commit"
else
    echo " Looks good."
fi


echo -n "Running texi2dvi..."
texi2dvi --batch manual.de.texi > texi2dvi.out

if [ $? != 0 ]; then
    die "Manual has errors - fix before you commit (saved in texi2dvi.out)"
else
    rm texi2dvi.out
    echo " Looks good."
fi

echo
echo
echo "Please examine your modifications in \`manual.de.html'."
echo
echo "If you would like to use a different browser, set the 'BROWSER' environment"
echo "variable." 
echo

$BROWSER file:`pwd`/manual.de_toc.html

echo "-- Press Enter to Continue --"
read junk
cleanup