]> de.git.xonotic.org Git - xonotic/xonotic-maps.pk3dir.git/commitdiff
shader-audit: work without mktemp
authorRudolf Polzer <divverent@alientrap.org>
Thu, 5 Aug 2010 11:03:00 +0000 (13:03 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 5 Aug 2010 11:03:00 +0000 (13:03 +0200)
scripts/shader-audit.sh [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 95454f8..c90a4e7
@@ -1,5 +1,11 @@
 #!/bin/sh
 
 #!/bin/sh
 
+case "$0" in
+       */*)
+               cd "${0%/*}"
+               ;;
+esac
+
 LF="
 "
 
 LF="
 "
 
@@ -280,12 +286,9 @@ strip_comments()
        sed 's,//.*,,g; s,\r, ,g; s,\t, ,g; s,  *, ,g; s, $,,; s,^ ,,; /^$/ d'
 }
 
        sed 's,//.*,,g; s,\r, ,g; s,\t, ,g; s,  *, ,g; s, $,,; s,^ ,,; /^$/ d'
 }
 
-t=`mktemp`
 for X in *.shader; do
 for X in *.shader; do
-       strip_comments < "$X" > "$t"
-       parse_shaderfile "${X%.shader}" < "$t"
+       strip_comments < "$X" | parse_shaderfile "${X%.shader}"
 done
 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`
 
 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`