File: checks.sh

package info (click to toggle)
qabcs 1.0.2-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,724 kB
  • sloc: cpp: 2,226; sh: 2,001; xml: 25; makefile: 5
file content (56 lines) | stat: -rwxr-xr-x 1,258 bytes parent folder | download | duplicates (3)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#/bin/sh
# Author: Alexey Loginov
# Licence: GPLv3+
# Description: check extra noises and pictures, that are not in use

pushd ..

tmpfile="tmpfile"
found="false"

rm -f $tmpfile

for file in `find abcs -name *.properties`
do
  if [ -z "`cat $file|grep "visible:false"`" ] || [ "$file" = "abcs/en/abc1.properties" ]
  then
    cat $file|grep -v '\[missing\]'|grep -v language|grep -v visible| grep -v inheritsFrom | grep -v author|grep -v espeak_params|grep -v view_letters|grep -v speak_method|grep -v typing| grep -v "#" >> $tmpfile
  fi
done

pics="`find abcs/all/pics -name "*.*"|cut -d "/" -f 5|cut -d "." -f 1`"
words="`cat $tmpfile|cut -d "=" -f 4`"

noises_f="`find abcs/all/noises -name "*.*"|cut -d "/" -f 4|cut -d "." -f 1`"
noises="`cat $tmpfile|cut -d "=" -f 5`"

for key in $pics
do
    if echo "$words" | grep --quiet --line-regexp --fixed-strings "${key}"
    then
      true
    else
      echo "Picture '$key' is not in use!"
      found="true"
    fi
done

for key in $noises_f
do
    if echo "$noises" | grep --quiet --line-regexp --fixed-strings "${key}"
    then
      true
    else
      echo "Noise '$key' is not in use!"
      found="true"
    fi
done

rm -f $tmpfile

popd

if [ $found = "false" ]
then
  echo "Everything is OK"
fi