]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - update-cvarcount.sh
don't care if a BOT can see a warp getting rearranged
[xonotic/xonotic-data.pk3dir.git] / update-cvarcount.sh
1 #!/bin/sh
2
3 countw=`awk '/^seta? g_/ { print $2; }' balanceXonotic.cfg       | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32`
4 for b in balance*.cfg; do
5         countb=`awk '/^seta? g_/ { print $2; }' "$b"  | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32`
6         if [ "$countw" != "$countb" ]; then
7                 echo "Mismatch between balanceXonotic.cfg and $b. Aborting."
8                 echo "Differences are:"
9                 A=`mktemp`
10                 B=`mktemp`
11                 awk '/^seta? g_/ { print $2; }' balanceXonotic.cfg       | sort -u | tr -d '\r' > "$A"
12                 awk '/^seta? g_/ { print $2; }' "$b"                     | sort -u | tr -d '\r' > "$B"
13                 echo "< missing in $b"
14                 echo "> must get removed from $b"
15                 diff "$A" "$B" | grep '^[<>]' | sort
16                 rm -f "$A" "$B"
17                 exit 1
18         fi
19 done