From: Rudolf Polzer Date: Sat, 25 Sep 2010 10:47:17 +0000 (+0200) Subject: shader-audit: return a status X-Git-Tag: xonotic-v0.1.0preview~151^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8328b766c0767da25b7b15995470d9a577124cc6;p=xonotic%2Fxonotic-maps.pk3dir.git shader-audit: return a status --- diff --git a/scripts/shader-audit.sh b/scripts/shader-audit.sh index 46d92795..a203d037 100755 --- a/scripts/shader-audit.sh +++ b/scripts/shader-audit.sh @@ -286,24 +286,36 @@ strip_comments() sed 's,//.*,,g; s,\r, ,g; s,\t, ,g; s, *, ,g; s, $,,; s,^ ,,; /^$/ d' } -t=`mktemp || echo ".temp"` -for X in *.shader; do - strip_comments < "$X" > "$t" - parse_shaderfile "${X%.shader}" < "$t" -done -rm -f "$t" +{ + t=`mktemp || echo ".temp"` + for X in *.shader; do + strip_comments < "$X" > "$t" + parse_shaderfile "${X%.shader}" < "$t" + done + rm -f "$t" -textures_avail=`( cd ..; find textures/ -type f -not -name '*_norm.*' -not -name '*_glow.*' -not -name '*_gloss.*' -not -name '*_reflect.*' -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 '*_reflect.*' -not -name '*.xcf' ) | while IFS= read -r T; do normalize "$T"; done | sort -u` + textures_used=`echo "${textures_used#$LF}" | sort -u` -echo "$textures_used$LF$textures_used$LF$textures_avail" | sort | uniq -u | while IFS= read -r L; do - case "$L" in - textures/radiant/*) - ;; - textures/map_*/*) - ;; - *) - echo "(EE) texture $L is not referenced by any shader" - ;; - esac -done + echo "$textures_used$LF$textures_used$LF$textures_avail" | sort | uniq -u | while IFS= read -r L; do + case "$L" in + textures/radiant/*) + ;; + textures/map_*/*) + ;; + *) + echo "(EE) texture $L is not referenced by any shader" + ;; + esac + done +} | { + return=true + while IFS= read -r STATUS TEXT; do + case "$STATUS" in + '(EE)') + return=false + ;; + esac + done + $return +}