7 PATH=/usr/local/bin:$PATH
8 WWWBASE=/www/gcc/htdocs
10 # Process options -rrelease and -ddirectory
14 while [ $# -gt 0 ]; do
17 if [ -n "$RELEASE" ]; then
18 echo "Multiple releases specified" >&2
22 if [ -z "$RELEASE" ]; then
25 if [ -z "$RELEASE" ]; then
26 echo "No release specified with -r" >&2
32 if [ -n "$SUBDIR" ]; then
33 echo "Multiple subdirectories specified" >&2
37 if [ -z "$SUBDIR" ]; then
40 if [ -z "$SUBDIR" ]; then
41 echo "No subdirectory specified with -d" >&2
47 echo "Unknown argument \"$1\"" >&2
54 if [ -n "$RELEASE" ] && [ -z "$SUBDIR" ]; then
55 echo "Release specified without subdirectory" >&2
59 if [ -z "$SUBDIR" ]; then
60 DOCSDIR=$WWWBASE/onlinedocs
62 DOCSDIR=$WWWBASE/onlinedocs/$SUBDIR
65 if [ ! -d $DOCSDIR ]; then
69 if [ -z "$RELEASE" ]; then
76 WORKDIR=/tmp/gcc-doc-update.$$
82 # Find all the texi files in the repository, except those in directories
83 # we do not care about (Attic, texinfo, etc).
84 find $CVSROOT/gcc -name \*.texi,v -print | fgrep -v -f/home/gccadmin/scripts/doc_exclude | sed -e s#$CVSROOT/##g -e s#,v##g > FILES
87 # Checkout all the texi files and get them into a single directory.
88 # If we ever have texi files with the same name we'll have to do this
90 cvs -Q co -r$RELEASE `cat FILES`
91 mv `find . -name \*.texi -print` .
93 # Now convert the relavent files from texi to html
94 for file in c-tree cpp chill cppinternals gcc gcj g77 objc-features porting; do
95 if [ -e ${file}.texi ]; then
96 /usr/local/bin/texi2html -glossary -menu -split_chapter ${file}.texi
100 # Then build a gzipped copy of each of the resulting .html files
101 for file in *.html; do
102 cat $file | gzip --best > $file.gz
105 # On the 15th of the month, wipe all the old files from the
108 if test $today = 15; then
109 find $DOCSDIR -type f -maxdepth 1 -print | grep -v index.html | xargs rm
112 # And copy the resulting html files to the web server
113 for file in *.html; do
115 sed -e '/^<!-- Created on/d' \
116 -e '/^by <I>GCC Administrator<\/I> on/d' > file1
118 sed -e '/^<!-- Created on/d' \
119 -e '/^by <I>GCC Administrator<\/I> on/d' > file2
120 if cmp -s file1 file2; then
123 cp $file ${file}.gz $DOCSDIR
127 news_file=`grep "News About GNU Fortran" $DOCSDIR/g77_toc.html | sed -e '/HREF=.*[^.]/ s#^.*HREF="##g' | sed -e 's%#SEC.*%%g'`
128 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'`
129 contrib_file=`grep "Contributors to GCC" $DOCSDIR/gcc_toc.html | sed -e '/HREF=.*[^.]/ s#^.*HREF="##g' | sed -e 's%#SEC.*%%g'`
135 rm -f g77_news.html.gz
136 rm -f g77_bugs.html.gz
137 ln $news_file g77_news.html
138 ln $bugs_file g77_bugs.html
139 ln ${news_file}.gz g77_news.html.gz
140 ln ${bugs_file}.gz g77_bugs.html.gz
142 if [ "$DO_THANKS_HTML" = y ]; then
146 ln onlinedocs/$contrib_file thanks.html
147 ln onlinedocs/${contrib_file}.gz thanks.html.gz