From: Rudolf Polzer Date: Thu, 5 Aug 2010 11:03:00 +0000 (+0200) Subject: shader-audit: work without mktemp X-Git-Tag: xonotic-v0.1.0preview~141^2~2^2~1^2 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-maps.pk3dir.git;a=commitdiff_plain;h=d921f21a0d29d43961fc1774163435363275cd36 shader-audit: work without mktemp --- diff --git a/scripts/shader-audit.sh b/scripts/shader-audit.sh old mode 100644 new mode 100755 index 95454f83..c90a4e75 --- a/scripts/shader-audit.sh +++ b/scripts/shader-audit.sh @@ -1,5 +1,11 @@ #!/bin/sh +case "$0" in + */*) + cd "${0%/*}" + ;; +esac + LF=" " @@ -280,12 +286,9 @@ strip_comments() sed 's,//.*,,g; s,\r, ,g; s,\t, ,g; s, *, ,g; s, $,,; s,^ ,,; /^$/ d' } -t=`mktemp` for X in *.shader; do - strip_comments < "$X" > "$t" - parse_shaderfile "${X%.shader}" < "$t" + strip_comments < "$X" | parse_shaderfile "${X%.shader}" done -rm -f "$t" textures_avail=`( cd ..; find textures/ -type f -not -name '*_norm.*' -not -name '*_glow.*' -not -name '*_gloss.*' -not -name '*.xcf' ) | while IFS= read -r T; do normalize "$T"; done | sort -u` textures_used=`echo "${textures_used#$LF}" | sort -u`