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