File: check.sh

package info (click to toggle)
gtksourceview2 2.2.2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,856 kB
  • ctags: 1,896
  • sloc: ansic: 18,630; sh: 9,199; xml: 4,509; python: 424; makefile: 272
file content (41 lines) | stat: -rwxr-xr-x 694 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
# "./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

check_file() {
  case $1 in
  testv1.lang) ;; # skip test file for old format
  *.xml)
    xmllint --relaxng styles.rng --noout $file || exit 1
    ;;
  *)
    xmllint --relaxng language2.rng --noout $file || exit 1
    ;;
  esac
}

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
    msil.lang) ;;
    *)
      langs="$langs $l"
      ;;
  esac
done

for file in $langs *.xml; do
  check_file $file
done