X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=update-cvarcount.sh;h=0024010420e5a06168e479f2e20046db328b3f7c;hb=a6df31e62548b64d6f801bc5d50a1f51e4ac27b8;hp=55727d9e008885150322e39ff2d5eed32f5b858e;hpb=0e7ed909bffb4ff21f0c68d163edfc17487e380a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/update-cvarcount.sh b/update-cvarcount.sh index 55727d9e0..002401042 100755 --- a/update-cvarcount.sh +++ b/update-cvarcount.sh @@ -1,12 +1,24 @@ #!/bin/sh -balance_cfgs="balanceHavoc.cfg balance25.cfg balanceSamual.cfg balanceNexrun.cfg" - -countw=`awk '/^seta? g_/ { print $2; }' balance.cfg | sort -u | tr -d '\r' | md5sum | cut -c 1-32` -for b in $balance_cfgs; do - countb=`awk '/^seta? g_/ { print $2; }' "$b" | sort -u | tr -d '\r' | md5sum | cut -c 1-32` +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 balance.cfg and $b. Aborting." - exit 1 + 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 +if $errord; then + echo "Please wait for 30 seconds, so you have had enough time to read this..." + sleep 30 +fi