From d921f21a0d29d43961fc1774163435363275cd36 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 5 Aug 2010 13:03:00 +0200 Subject: [PATCH] shader-audit: work without mktemp --- scripts/shader-audit.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) mode change 100644 => 100755 scripts/shader-audit.sh 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` -- 2.39.2