X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Ftools%2Fcached-converter.sh;h=e11b4576fa74441ef46f9d49668c5dadb3ee8a1a;hp=a9098cbfad93f210c5d3782bb6d5f7010abcd5e9;hb=54d203c9b171a752a11f3e00bedb8420438b26c0;hpb=b60cfbb1ea312f06180945a91a616a5273d7c216 diff --git a/misc/tools/cached-converter.sh b/misc/tools/cached-converter.sh index a9098cbf..e11b4576 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,8 +114,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,9 +186,11 @@ 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/*) ;; - ./maps/*/*) ;; ./particles/*) ;; ./progs/*) ;; *) @@ -245,7 +258,7 @@ for F in "$@"; do if [ -f "dds/${f}.dds" ]; then if [ -z "${f##./textures/*}" ]; then if [ -n "${f##./textures/*/*}" ]; then - ln -snf "textures/${f%./textures/}.dds" "dds/${f%./textures/}.dds" + ln -snf "textures/${f#./textures/}.dds" "dds/${f#./textures/}.dds" fi fi fi