Home | History | Annotate | Line # | Download | only in maintainer-scripts
      1 #!/bin/bash
      2 
      3 
      4 # "sh update_web_docs_libstdcxx_git"
      5 # Checks out a copy of the libstdc++-v3 "inner" documentation and puts
      6 # it in the onlinedocs area.  For an initial description of "inner"
      7 # docs, see the thread starting with 
      8 #     http://gcc.gnu.org/ml/libstdc++/2000-11/msg00475.html
      9 #####################################################################
     10 
     11 GITROOT=${GITROOT:-"/git/gcc.git"}
     12 GETTHIS='libstdc++-v3/doc/html'
     13 WWWDIR=/www/gcc/htdocs/onlinedocs/libstdc++
     14 #WWWDIR=/tmp/fake-onlinedocs-testing
     15 
     16 
     17 ## No more changes should be needed.  Ha, right, whatever.
     18 #####################################################################
     19 
     20 FILTER="newer or same age version exists|0 blocks"
     21 
     22 PATH=/usr/local/bin:$PATH
     23 export GITROOT
     24 
     25 test -d $WWWDIR || /bin/mkdir $WWWDIR
     26 test -d $WWWDIR || { echo something is very wrong ; exit 1; }
     27 
     28 WORKDIR=/tmp/v3-doc-update.$$
     29 /bin/rm -rf $WORKDIR
     30 /bin/mkdir $WORKDIR
     31 cd $WORKDIR
     32 
     33 
     34 # checkout all the HTML files, get down into an interesting directory
     35 git -C $GITROOT archive master $GETTHIS | tar xf -
     36 cd $GETTHIS
     37 
     38 # copy the tree to the onlinedocs area, preserve directory structure
     39 find . -depth -print | cpio -pd $WWWDIR 2>&1 | egrep -v "$FILTER"
     40 
     41 err=${PIPESTATUS[1]}
     42 if [ $err -gt 0 ]; then
     43     printf "\nCopying failed with error code %d.\n" $err
     44 fi
     45 
     46 cd /
     47 /bin/rm -rf $WORKDIR
     48 
     49