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 gxxint g77 objc-features porting; do
95 /usr/local/bin/texi2html -glossary -menu -split_chapter ${file}.texi
98 # Then build a gzipped copy of each of the resulting .html files
99 for file in *.html; do
100 cat $file | gzip --best > $file.gz
103 # On the 15th of the month, wipe all the old files from the
106 if test $today = 15; then
107 find $DOCSDIR -type f -maxdepth 1 -print | grep -v index.html | xargs rm
110 # And copy the resulting html files to the web server
111 for file in *.html; do
113 sed -e '/^<!-- Created on/d' \
114 -e '/^by <I>GCC Administrator<\/I> on/d' > file1
116 sed -e '/^<!-- Created on/d' \
117 -e '/^by <I>GCC Administrator<\/I> on/d' > file2
118 if cmp -s file1 file2; then
121 cp $file ${file}.gz $DOCSDIR
125 news_file=`grep "News About GNU Fortran" $DOCSDIR/g77_toc.html | sed -e '/HREF=.*[^.]/ s#^.*HREF="##g' | sed -e 's%#SEC.*%%g'`
126 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'`
127 contrib_file=`grep "Contributors to GCC" $DOCSDIR/gcc_toc.html | sed -e '/HREF=.*[^.]/ s#^.*HREF="##g' | sed -e 's%#SEC.*%%g'`
133 rm -f g77_news.html.gz
134 rm -f g77_bugs.html.gz
135 ln $news_file g77_news.html
136 ln $bugs_file g77_bugs.html
137 ln ${news_file}.gz g77_news.html.gz
138 ln ${bugs_file}.gz g77_bugs.html.gz
140 if [ "$DO_THANKS_HTML" = y ]; then
144 ln onlinedocs/$contrib_file thanks.html
145 ln onlinedocs/${contrib_file}.gz thanks.html.gz