]>
git.saurik.com Git - wxWidgets.git/blob - build/buildbot/tools/check.sh
2 #############################################################################
4 # Purpose: Offline checker for the buildbot configuration files
5 # Author: Mike Wetherell
6 # Copyright: (c) 2007 Mike Wetherell
7 # Licence: wxWindows licence
8 #############################################################################
11 echo "Usage: $0 [options] FILE..."
12 echo "Offline checker for the buildbot configuration files"
15 echo " -g generate xslt"
17 echo " -l N output only line N"
24 echo "try '$0 -h' for more information" >&2
30 $prog --version >/dev
/null
2>&1 || {
31 echo "$0: requires $prog, not found" >&2
43 while getopts ghl
:pv opt
; do
48 l
) FILTER
="sed -ne ${OPTARG}p" ;;
49 p
) MODE
=$PREPROCESS ;;
54 if [ $OPTIND -gt 1 ]; then
55 shift `expr $OPTIND - 1`
69 WORKDIR
="${TMPDIR:-/tmp}/wx.$$"
70 mkdir "$WORKDIR" || exit
71 trap 'rm -rf "$WORKDIR"' EXIT
72 WORKPAT
=`echo "$WORKDIR" | sed 's|[^A-Za-z0-9]/|.|g'`
75 STDERR
="$WORKDIR/STDERR"
78 # Filter to show lines of genertated XSLT when they are mentioned.
82 if (sub(/.*generated XSLT line */, "") && sub(/[^0-9].*/, ""))
84 system("sed -ne "$0"p '$XSLT'");
89 # Test it works as old version of awk don't have sub or system functions.
90 if showxslt
</dev
/null
2>/dev
/null
; then
96 # Change the names of the temporary files in an error message to something
97 # to something more informative
102 if [ -s "$STDERR" ]; then
103 sed "s|file ${WORKPAT}|${WORKPAT}|g;\
104 s|${WORKPAT}/XSLT|generated XSLT|g;\
105 s|${WORKPAT}/PREP|$NAME (preprocessed)|g" "$STDERR" | $SHOWXSLT
118 if $XSLTPROC --xinclude -o "$XSLT" $DIR/embedded.xsl
"$INPUT" 2>"$STDERR" &&
121 if [ $MODE -eq $GENERATE ]; then
133 if [ $MODE -lt $PREPROCESS ]; then
137 if $XSLTPROC --xinclude -o "$PREP" "$XSLT" "$INPUT" 2>"$STDERR" &&
140 if [ $MODE -eq $PREPROCESS ]; then
152 if [ $MODE -lt $VALIDATE ]; then
156 if $XMLLINT --noout --schema $DIR/bot.xsd
"$PREP" 2>"$STDERR"
164 while [ $# -gt 0 ]; do
166 NAME
="`echo \"$INPUT\" | sed 's/[|\]/\\\&/g'`"
170 preprocess
"$INPUT" &&
177 rm -f "$XSLT" "$PREP" "$STDERR"