X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=update-cvarcount.sh;h=0024010420e5a06168e479f2e20046db328b3f7c;hb=7437881bd613f58a51f2aab49b5769881e69c9d2;hp=b82840ae0873fcf9fc38d3a7c71330199338df2e;hpb=777ca1aaba7e571c96473f75e39012c42f2375af;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/update-cvarcount.sh b/update-cvarcount.sh index b82840ae0..002401042 100755 --- a/update-cvarcount.sh +++ b/update-cvarcount.sh @@ -1,19 +1,24 @@ #!/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:" - A=`mktemp` - B=`mktemp` - 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" 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" - exit 1 + 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