medit/moo/mooedit/langs/check.sh

42 lines
694 B
Bash
Raw Normal View History

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