]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/terencehill/hud_skin_files_sync'
authorRudolf Polzer <divverent@alientrap.org>
Thu, 5 Jan 2012 09:36:36 +0000 (10:36 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 5 Jan 2012 09:36:36 +0000 (10:36 +0100)
update-cvarcount.sh

index 0024010420e5a06168e479f2e20046db328b3f7c..78985b81947af96ede8d5800c0bb1d42f38e35aa 100755 (executable)
@@ -1,23 +1,31 @@
 #!/bin/sh
 
 errord=false
-countw=`awk '/^seta? g_/ { print $2; }' balanceXonotic.cfg       | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32`
-for b in balance*.cfg; do
-       countb=`awk '/^seta? g_/ { print $2; }' "$b"  | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32`
-       if [ "$countw" != "$countb" ]; then
-               echo "Mismatch between balanceXonotic.cfg and $b. Aborting."
-               echo "Differences are:"
-               echo "< missing in $b"
-               echo "> must get removed from $b"
-               A=`mktemp || echo a.tmp`
-               B=`mktemp || echo b.tmp`
-               awk '/^seta? g_/ { print $2; }' balanceXonotic.cfg       | sort -u | tr -d '\r' > "$A"
-               awk '/^seta? g_/ { print $2; }' "$b"                     | sort -u | tr -d '\r' > "$B"
-               diff "$A" "$B" | grep '^[<>]' | sort
-               rm -f "$A" "$B"
-               errord=true
-       fi
-done
+
+check_files()
+{
+       countw=`awk ''"$3"' { print $2; }' "$1" | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32`
+       for b in $2; do
+               countb=`awk ''"$3"' { print $2; }' "$b" | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32`
+               if [ "$countw" != "$countb" ]; then
+                       echo "Mismatch between "$1" and $b. Aborting."
+                       echo "Differences are:"
+                       echo "< missing in $b"
+                       echo "> must get removed from $b"
+                       A=`mktemp || echo a.tmp`
+                       B=`mktemp || echo b.tmp`
+                       awk ''"$3"' { print $2; }' "$1"      | sort -u | tr -d '\r' > "$A"
+                       awk ''"$3"' { print $2; }' "$b"                     | sort -u | tr -d '\r' > "$B"
+                       diff "$A" "$B" | grep '^[<>]' | sort
+                       rm -f "$A" "$B"
+                       errord=true
+               fi
+       done
+}
+
+check_files "balanceXonotic.cfg" "balance*.cfg" "/^seta? g_/"
+check_files "_hud_descriptions.cfg" "hud_*.cfg" "/^seta? hud_/"
+
 if $errord; then
        echo "Please wait for 30 seconds, so you have had enough time to read this..."
        sleep 30