From: terencehill Date: Sun, 4 Dec 2011 21:17:30 +0000 (+0100) Subject: Expand update-cvarcount.sh to check hud skin files too X-Git-Tag: xonotic-v0.6.0~188^2~26^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=43e872369ee1d37e67c47e74d65da255eda7e491;p=xonotic%2Fxonotic-data.pk3dir.git Expand update-cvarcount.sh to check hud skin files too --- diff --git a/update-cvarcount.sh b/update-cvarcount.sh index 002401042..d59d9ac45 100755 --- a/update-cvarcount.sh +++ b/update-cvarcount.sh @@ -1,23 +1,35 @@ #!/bin/sh +maincfg[0]=balanceXonotic.cfg + cfgs[0]=balance*.cfg + prefix[0]="/^seta? g_/" + +maincfg[1]=_hud_descriptions.cfg + cfgs[1]=hud_*.cfg + prefix[1]="/^seta? hud_/" + 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 + +for index in 0 1; do + countw=`awk ''"${prefix[index]}"' { print $2; }' "${maincfg[index]}" | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32` + for b in ${cfgs[index]}; do + countb=`awk ''"${prefix[index]}"' { print $2; }' "$b" | sort -u | tr -d '\r' | git hash-object --stdin | cut -c 1-32` + if [ "$countw" != "$countb" ]; then + echo "Mismatch between "${maincfg[index]}" 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 ''"${prefix[index]}"' { print $2; }' "${maincfg[index]}" | sort -u | tr -d '\r' > "$A" + awk ''"${prefix[index]}"' { print $2; }' "$b" | sort -u | tr -d '\r' > "$B" + diff "$A" "$B" | grep '^[<>]' | sort + rm -f "$A" "$B" + errord=true + fi + done done + if $errord; then echo "Please wait for 30 seconds, so you have had enough time to read this..." sleep 30