]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - check-cvars.sh
Add a mutator hook to indicate whether the physics HUD panel should be shown when...
[xonotic/xonotic-data.pk3dir.git] / check-cvars.sh
1 #!/bin/sh
2
3 errord=false
4
5 check_files()
6 {
7         countw=`awk ''"$3"' { print $2; }' "$1" | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32`
8         for b in $2; do
9                 if [ "$b" = "balance-testing.cfg" ] || [ "$b" = "balance-testingxpm.cfg" ]; then
10                         continue
11                 fi
12
13                 countb=`awk ''"$3"' { print $2; }' "$b" | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32`
14                 if [ "$countw" != "$countb" ]; then
15                         echo "Mismatch between $1 and $b. Aborting."
16                         echo "Differences are:"
17                         echo "< missing in $b"
18                         echo "> must get removed from $b"
19                         A=`mktemp || echo a.tmp`
20                         B=`mktemp || echo b.tmp`
21                         awk ''"$3"' { print $2; }' "$1" | sort -u | tr -d '\r' > "$A"
22                         awk ''"$3"' { print $2; }' "$b" | sort -u | tr -d '\r' > "$B"
23                         diff "$A" "$B" | grep '^[<>]' | sort
24                         rm -f "$A" "$B"
25                         errord=true
26                 fi
27         done
28 }
29
30 check_files "balance-xonotic.cfg" "balance-*.cfg" "/^seta? g_/"
31 check_files "bal-wep-xonotic.cfg" "bal-wep-*.cfg" "/^seta? g_/"
32 check_files "_hud_descriptions.cfg" "hud_*.cfg" "/^seta? hud_/"
33
34 if $errord; then
35     if [ "$CMAKE" != "" ]; then
36             exit 1
37         fi
38         echo "Please wait for 30 seconds, so you have had enough time to read this..."
39         sleep 30
40 fi