7 PATH=/usr/local/bin:$PATH
9 WWWBASE=/www/gcc/htdocs
10 WWWBASE_PREFORMATTED=/www/gcc/htdocs-preformatted
11 PREPROCESS=/www/gcc/bin/preprocess
13 # Process options -rrelease and -ddirectory
17 while [ $# -gt 0 ]; do
20 if [ -n "$RELEASE" ]; then
21 echo "Multiple releases specified" >&2
25 if [ -z "$RELEASE" ]; then
28 if [ -z "$RELEASE" ]; then
29 echo "No release specified with -r" >&2
35 if [ -n "$SUBDIR" ]; then
36 echo "Multiple subdirectories specified" >&2
40 if [ -z "$SUBDIR" ]; then
43 if [ -z "$SUBDIR" ]; then
44 echo "No subdirectory specified with -d" >&2
50 echo "Unknown argument \"$1\"" >&2
57 if [ -n "$RELEASE" ] && [ -z "$SUBDIR" ]; then
58 echo "Release specified without subdirectory" >&2
62 if [ -z "$SUBDIR" ]; then
63 DOCSDIR=$WWWBASE/onlinedocs
65 DOCSDIR=$WWWBASE/onlinedocs/$SUBDIR
68 if [ ! -d $DOCSDIR ]; then
72 if [ -z "$RELEASE" ]; then
79 WORKDIR=/tmp/gcc-doc-update.$$
85 # Find all the texi files in the repository, except those in directories
86 # we do not care about (texinfo, etc).
87 find $CVSROOT/gcc -name \*.texi,v -print | fgrep -v -f/home/gccadmin/scripts/doc_exclude | sed -e s#$CVSROOT/##g -e s#,v##g -e s#Attic/##g > FILES
90 # Checkout all the texi files and get them into a single directory.
91 # If we ever have texi files with the same name we'll have to do this
93 cvs -Q co -r$RELEASE `cat FILES` gcc/gcc/doc/install.texi2html gcc/gcc/texinfo.tex gcc/gcc/doc/texinfo.tex
94 mv `find . -name \*.texi -print` .
95 mv `find . -name \*.tex -print` .
97 # Now convert the relevant files from texi to HTML and PostScript.
98 for file in cpp chill cppinternals gcc gcj g77 objc-features porting; do
99 if [ -e ${file}.texi ]; then
100 /usr/local/bin/texi2html -glossary -menu -split_chapter ${file}.texi
101 texi2dvi ${file}.texi </dev/null && dvips -o ${file}.ps ${file}.dvi
105 # Then build a gzipped copy of each of the resulting .html and .ps files
106 for file in *.html *.ps; do
107 cat $file | gzip --best > $file.gz
110 # On the 15th of the month, wipe all the old files from the
113 if test $today = 15; then
114 find $DOCSDIR -type f -maxdepth 1 -print | grep -v index.html | xargs rm
117 # And copy the resulting html files to the web server
118 for file in *.html *.ps; do
120 sed -e '/^<!-- Created on/d' \
121 -e '/^by <I>GCC Administrator<\/I> on/d' \
122 -e '/^%DVIPSSource:/d' > file1
124 sed -e '/^<!-- Created on/d' \
125 -e '/^by <I>GCC Administrator<\/I> on/d' \
126 -e '/^%DVIPSSource:/d' > file2
127 if cmp -s file1 file2; then
130 cp $file ${file}.gz $DOCSDIR
134 news_file=`grep "News About GNU Fortran" $DOCSDIR/g77_toc.html | sed -e '/HREF=.*[^.]/ s#^.*HREF="##g' | sed -e 's%#SEC.*%%g'`
135 bugs_file=`grep "Known Causes of Trouble with GNU Fortran" $DOCSDIR/g77_toc.html | sed -e '/HREF=.*[^.]/ s#^.*HREF="##g' | sed -e 's%#SEC.*%%g'`
136 contrib_file=`grep "Contributors to GCC" $DOCSDIR/gcc_toc.html | sed -e '/HREF=.*[^.]/ s#^.*HREF="##g' | sed -e 's%#SEC.*%%g'`
142 rm -f g77_news.html.gz
143 rm -f g77_bugs.html.gz
144 ln $news_file g77_news.html
145 ln $bugs_file g77_bugs.html
146 ln ${news_file}.gz g77_news.html.gz
147 ln ${bugs_file}.gz g77_bugs.html.gz
149 if [ "$DO_THANKS_HTML" = y ]; then
153 ln onlinedocs/$contrib_file thanks.html
154 ln onlinedocs/${contrib_file}.gz thanks.html.gz
157 # Finally, generate the installation documentation.
159 DESTDIR=$WWWBASE_PREFORMATTED/install
162 $WORKDIR/gcc/gcc/doc/install.texi2html
164 for file in `ls $DESTDIR`
166 $PREPROCESS install/$file
169 # Clean up behind us.