3 WWWDIR
="`dirname \"$0\"`"
6 LOCALFILE
="$WWWDIR/$2/`basename \"$1\"`"
7 test -f "$LOCALFILE" || wget
-O "$LOCALFILE" "$1"
10 # Download files necessary to preview the web pages locally.
11 if [ ! -r "$WWWDIR/branding/.download-complete" ]; then
12 BRANDING_URL
="http://subversion.tigris.org/branding"
13 mkdir
-p "$WWWDIR/branding/"{css
,scripts
,images
}
14 for i
in tigris inst print
; do
15 ensure
"$BRANDING_URL/css/$i.css" "branding/css"
17 ensure
"$BRANDING_URL/scripts/tigris.js" "branding/scripts"
18 for f
in `sed -n -e 's,.*url(\.\./images/\([^)]*\).*,\1,;tp' \
19 -etp -ed -e:p -ep $WWWDIR/branding/css/*.css`; do
21 collapsed_big.gif|expanded_big.gif
) ;; # 404!
22 *) ensure
"$BRANDING_URL/images/$f" "branding/images" ;;
25 touch "$WWWDIR/branding/.download-complete"
28 # Check we have DTDs available
29 LOCAL_CATALOG
="$WWWDIR/xhtml1.catalog"
30 if [ ! -r "$LOCAL_CATALOG" ]; then
31 RESULT
=`echo 'resolve "-//W3C//DTD XHTML 1.0 Strict//EN" ' \
32 '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"' | xmlcatalog --shell`
34 */xhtml1-strict.dtd
*) ;;
36 ensure
"http://www.w3.org/TR/xhtml1/xhtml1.tgz" "."
37 rm -rf "$WWWDIR/xhtml1-20020801" "$LOCAL_CATALOG"
38 tar -zxvf "$WWWDIR/xhtml1.tgz"
39 xmlcatalog
--noout --create "$LOCAL_CATALOG"
40 xmlcatalog
--noout --add rewriteSystem
"http://www.w3.org/TR/xhtml1/" \
41 "`cd \"$WWWDIR\" && pwd`/xhtml1-20020801/" "$LOCAL_CATALOG"
45 test -r "$LOCAL_CATALOG" && export XML_CATALOG_FILES
="$LOCAL_CATALOG"
47 if [ $# -eq 0 ]; then echo "Usage: ./validate.sh <filename>..." >&2; exit 1; fi
48 if [ "$1" = "all" ]; then
49 set - "$WWWDIR"/*.html
"$WWWDIR"/merge-tracking
/*.html
51 if [ $# -eq 1 ]; then xmllint
--nonet --noout --valid "$1"; exit $?
; fi
55 *project_tools.html
) echo "$f: Skipped" ;;
56 *.html
) xmllint
--nonet --noout --valid "$f" && echo -e \
57 "$f: "'\033[32mvalid\033[0m' ||
echo -e "$f: "'\033[31;1mINVALID\033[0m' ;;
58 *) echo "$f: Not HTML" ;;