]>
git.saurik.com Git - wxWidgets.git/blob - build/buildbot/tools/check.sh
d5acae0e2816c71affee54ccfabc62310bb2aa2d
2 #############################################################################
4 # Purpose: Offline checker for the buildbot configuration files
5 # Author: Mike Wetherell
7 # Copyright: (c) 2007 Mike Wetherell
8 # Licence: wxWindows licence
9 #############################################################################
12 echo "Usage: $0 [options] FILE..."
13 echo "Offline checker for the buildbot configuration files"
16 echo " -g generate xslt"
18 echo " -l N output only line N"
25 echo "try '$0 -h' for more information" >&2
31 $prog --version >/dev
/null
2>&1 || {
32 echo "$0: requires $prog, not found" >&2
44 while getopts ghl
:pv opt
; do
49 l
) FILTER
="sed -ne ${OPTARG}p" ;;
50 p
) MODE
=$PREPROCESS ;;
55 if [ $OPTIND -gt 1 ]; then
56 shift `expr $OPTIND - 1`
70 WORKDIR
="${TMPDIR:-/tmp}/wx.$$"
71 mkdir "$WORKDIR" || exit
72 trap 'rm -rf "$WORKDIR"' EXIT
73 WORKPAT
=`echo "$WORKDIR" | sed 's|[^A-Za-z0-9]/|.|g'`
76 STDERR
="$WORKDIR/STDERR"
79 # Filter to show lines of genertated XSLT when they are mentioned.
83 if (sub(/.*generated XSLT line */, "") && sub(/[^0-9].*/, ""))
85 system("sed -ne "$0"p '$XSLT'");
90 # Test it works as old version of awk don't have sub or system functions.
91 if showxslt
</dev
/null
2>/dev
/null
; then
97 # Change the names of the temporary files in an error message to something
98 # to something more informative
103 if [ -s "$STDERR" ]; then
104 sed "s|file ${WORKPAT}|${WORKPAT}|g;\
105 s|${WORKPAT}/XSLT|generated XSLT|g;\
106 s|${WORKPAT}/PREP|$NAME (preprocessed)|g" "$STDERR" | $SHOWXSLT
119 if $XSLTPROC --xinclude -o "$XSLT" $DIR/embedded.xsl
"$INPUT" 2>"$STDERR" &&
122 if [ $MODE -eq $GENERATE ]; then
134 if [ $MODE -lt $PREPROCESS ]; then
138 if $XSLTPROC --xinclude -o "$PREP" "$XSLT" "$INPUT" 2>"$STDERR" &&
141 if [ $MODE -eq $PREPROCESS ]; then
153 if [ $MODE -lt $VALIDATE ]; then
157 if $XMLLINT --noout --schema $DIR/bot.xsd
"$PREP" 2>"$STDERR"
165 while [ $# -gt 0 ]; do
167 NAME
="`echo \"$INPUT\" | sed 's/[|\]/\\\&/g'`"
171 preprocess
"$INPUT" &&
178 rm -f "$XSLT" "$PREP" "$STDERR"