X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=misc%2Ftools%2Fcached-converter.sh;h=f6116a6571a71d55583a422fe0e63b6e3dea9872;hb=c445176a3613c07bc72409310bc638a9aa62fd7b;hp=ccbe0bb862a507b41b0b85d1cf905b0e5408d636;hpb=b28f4b26d4a58308f988b838bb10621e1cc48a0b;p=xonotic%2Fxonotic.git diff --git a/misc/tools/cached-converter.sh b/misc/tools/cached-converter.sh index ccbe0bb8..f6116a65 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 @@ -47,9 +48,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,8 +113,10 @@ reduce_ogg_ogg() { i=$1; shift; shift o=$1; shift; shift + 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" || true } reduce_wav_ogg() @@ -175,7 +185,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/*) ;;