X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Ftools%2Fcached-converter.sh;h=0bd61fdcd06aa8d913fed0b7ab18b0ebc624f27d;hp=ccbe0bb862a507b41b0b85d1cf905b0e5408d636;hb=713fc53d88aa6e9c3fd3c13e8be2b188c9245dad;hpb=b28f4b26d4a58308f988b838bb10621e1cc48a0b diff --git a/misc/tools/cached-converter.sh b/misc/tools/cached-converter.sh index ccbe0bb8..0bd61fdc 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"` oggdec -o "$tmpdir/x.wav" "$i" && \ oggenc -q"$1" -o "$o" "$tmpdir/x.wav" + echo "$tags" | vorbiscomment -R -w "$o" } 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/*) ;;