X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Ftools%2Fcached-converter.sh;h=d7bf5864a212a5e3cf323874f9e67d01509622fb;hp=d6fd4424230037993a8e0dea1db41fd6747f806d;hb=07ce56f65b1ad4e0aa07e4fa9cfdb4d9b97d4bb5;hpb=d0ad59f5d0412692a8e63ec3b0459a4d0d381b8b diff --git a/misc/tools/cached-converter.sh b/misc/tools/cached-converter.sh index d6fd4424..d7bf5864 100755 --- a/misc/tools/cached-converter.sh +++ b/misc/tools/cached-converter.sh @@ -12,6 +12,7 @@ set -e : ${do_ogg:=false} : ${ogg_qual:=1} : ${del_src:=false} +: ${git_src_repo:=} me=$0 case "$me" in @@ -40,6 +41,7 @@ cached() if ! $flag; then return 0 fi + sleep 0.25 if [ x"$infile1" = x"$outfile1" ]; then keep=true fi @@ -47,9 +49,16 @@ cached() if [ x"$infile1/../$infile2" = x"$lastinfiles" ]; then sum=$lastinfileshash else - sum=`git hash-object "$infile1"` - if [ -n "$infile2" ]; then - sum=$sum`git hash-object "$infile2"` + if [ -n "$git_src_repo" ]; then + sum=`( cd "$git_src_repo"; git rev-parse --revs-only HEAD:"${infile1#./}" | grep . ) || git hash-object "$infile1"` + if [ -n "$infile2" ]; then + sum=$sum`( cd "$git_src_repo"; git rev-parse --revs-only HEAD:"${infile2#./}" | grep . ) || git hash-object "$infile2"` + fi + else + sum=`git hash-object "$infile1"` + if [ -n "$infile2" ]; then + sum=$sum`git hash-object "$infile2"` + fi fi lastinfileshash=$sum fi @@ -105,10 +114,10 @@ reduce_ogg_ogg() { i=$1; shift; shift o=$1; shift; shift - tags=`vorbiscomment -R -l "$i"` + tags=`vorbiscomment -R -l "$i" || true` oggdec -o "$tmpdir/x.wav" "$i" && \ oggenc -q"$1" -o "$o" "$tmpdir/x.wav" - echo "$tags" | vorbiscomment -R -w "$o" + echo "$tags" | vorbiscomment -R -w "$o" || true } reduce_wav_ogg() @@ -177,7 +186,9 @@ for F in "$@"; do will_jpeg=$do_jpeg will_dds=$do_dds case "$f" in + *_bump) will_dds=false ;; ./models/player/*) will_dds=false ;; + ./models/sprites/*) will_dds=false ;; ./textures/*) ;; ./models/*) ;; ./particles/*) ;;