]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
update-cvarcount: small hack to make do without mktemp if needed
authorRudolf Polzer <divverent@alientrap.org>
Tue, 9 Nov 2010 06:10:44 +0000 (07:10 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 9 Nov 2010 06:10:44 +0000 (07:10 +0100)
update-cvarcount.sh

index b82840ae0873fcf9fc38d3a7c71330199338df2e..0bd63e9fb2ad9d57e61582ddf0d691cff8a5f831 100755 (executable)
@@ -6,12 +6,12 @@ for b in balance*.cfg; do
        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