X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=misc%2Fcheck-proj.sh;h=b43ec7aa40ad2ae7945c620a06d680a4badb92d3;hb=337d7ddbf4c330087e9923b580c757ec0f33fcb1;hp=a776f8c325f398bf2b823ca6f1c48c5ea0b6d25d;hpb=87fcf8d8e8109e6bf439ea8fde3bd9ce628eb85e;p=xonotic%2Fgmqcc.git diff --git a/misc/check-proj.sh b/misc/check-proj.sh index a776f8c..b43ec7a 100755 --- a/misc/check-proj.sh +++ b/misc/check-proj.sh @@ -69,9 +69,9 @@ fi if [ ! -d ~/.gmqcc/testsuite/projects ]; then mkdir -p ~/.gmqcc/testsuite/projects - local old="$PWD" + old="$PWD" cd ~/.gmqcc/testsuite/projects - echo "$(ls ../ | cat | grep -v '^hashes$' | grep -v '^projects$' | grep -v '^options$')" | while read -r line + echo "$(ls ../ | grep -v '^hashes$' | grep -v '^projects$' | grep -v '^options$')" | while read -r line do echo "extracting project $line" mkdir "$(echo "$line" | sed 's/\(.*\)\..*/\1/')" @@ -101,8 +101,9 @@ env -i type gmqcc 1>/dev/null 2>&1 || { end_dir="$PWD" cd ~/.gmqcc/testsuite/projects start="$PWD" -find . -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | while read -r line +find . -maxdepth 1 -mindepth 1 -type d | while read -r line do + line="${line#./}" echo -n "compiling $line... " cd "${start}/${line}" @@ -113,9 +114,10 @@ do do # change to subproject echo -n " compiling $dir... " - local old="$PWD" + old="$PWD" cd "$dir" - "$gmqcc_bin" $(cat ../../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}') > /dev/null 2>&1 + cmd="$(cat ../../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}')" + "$gmqcc_bin" $cmd > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "error" else @@ -125,7 +127,8 @@ do done # nope only one project else - "$gmqcc_bin" $(cat ../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}') > /dev/null 2>&1 + cmd="$(cat ../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}')" + "$gmqcc_bin" $cmd > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "error" else