X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Ftools%2Fcached-converter.sh;h=0eab3d6946f5ae9fc10048afd7704ffb38a35c97;hp=361265881865430d5b4ccaa09924d7bca6709003;hb=fc00291a3cabd0fc24767a221a9231f27c1a3e97;hpb=d1f465f3ecff3023e31a182a7e5803ee42e0357b diff --git a/misc/tools/cached-converter.sh b/misc/tools/cached-converter.sh index 36126588..0eab3d69 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 HEAD:"$infile1" )` + if [ -n "$infile2" ]; then + sum=`( cd "$git_src_repo"; git rev-parse HEAD:"$infile2" )` + fi + else + sum=`git hash-object "$infile1"` + if [ -n "$infile2" ]; then + sum=$sum`git hash-object "$infile2"` + fi fi lastinfileshash=$sum fi