2006-08-26 02:46:29 -07:00
|
|
|
#!/bin/sh
|
2007-06-29 03:43:00 -07:00
|
|
|
# "./check.sh files..." will validate files given on command line.
|
2007-07-11 22:51:57 -07:00
|
|
|
# "./check.sh" without arguments will validate all lang and styles files
|
|
|
|
# in the source directory
|
2006-08-26 02:46:29 -07:00
|
|
|
|
2007-07-04 20:24:09 -07:00
|
|
|
check_file() {
|
|
|
|
case $1 in
|
2007-06-29 03:43:00 -07:00
|
|
|
*.xml)
|
|
|
|
xmllint --relaxng styles.rng --noout $file || exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
xmllint --relaxng language2.rng --noout $file || exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2007-07-04 20:24:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ $1 ]; then
|
|
|
|
for file in $@; do
|
|
|
|
check_file $file
|
|
|
|
done
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$srcdir" ]; then
|
|
|
|
cd $srcdir
|
|
|
|
fi
|
|
|
|
|
2007-07-11 22:51:57 -07:00
|
|
|
langs=""
|
|
|
|
for l in *.lang; do
|
|
|
|
case $l in
|
2007-07-16 13:42:56 -07:00
|
|
|
msil.lang) ;;
|
2007-07-11 22:51:57 -07:00
|
|
|
*)
|
|
|
|
langs="$langs $l"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
for file in $langs *.xml; do
|
2007-07-04 20:24:09 -07:00
|
|
|
check_file $file
|
2006-08-26 02:46:29 -07:00
|
|
|
done
|