6 hashes="$location/hashes"
7 options="$location/options"
9 #download required things
10 download_list=$(wget -qO- ${list})
11 download_hashes=$(wget -qO- ${hashes})
12 download_options=$(wget -qO- ${options})
17 echo "$download_list" | while read -r line
19 echo "downloading $line ..."
20 wget -q "${location}/$line"
23 echo "$download_hashes" > ~/.gmqcc/testsuite/hashes
24 echo "$download_options" > ~/.gmqcc/testsuite/options
29 if [ -z "$download_list" -o -z "$download_hashes" -o -z "$download_options" ]; then
30 echo "failed to download required information to check projects."
32 if [ "$(ping -q -c1 "${host}")" ]; then
33 echo "host ${host} seems to be up but missing required files."
34 echo "please file bug report at: github.com/graphitemaster/gmqcc"
36 echo "host ${host} seems to be down, please try again later."
43 # we have existing contents around
44 if [ -f ~/.gmqcc/testsuite/hashes -a -f ~/.gmqcc/testsuite/options ]; then
45 echo "$download_hashes" > /tmp/gmqcc_download_hashes
46 echo "$download_options" > /tmp/gmqcc_download_options
48 diff -u ~/.gmqcc/testsuite/hashes /tmp/gmqcc_download_hashes > /dev/null
50 diff -u ~/.gmqcc/testsuite/options /tmp/gmqcc_download_options > /dev/null
53 if [ $check_hash -ne 0 -o $check_opts -ne 0 ]; then
54 echo "consistency errors in hashes (possible update), obtaining fresh contents"
55 rm -rf ~/.gmqcc/testsuite/projects
56 rm ~/.gmqcc/testsuite/*.zip
61 # do we even have the directory
62 echo "preparing project testsuite for the first time"
63 if [ ! -d ~/.gmqcc/testsuite ]; then
64 mkdir -p ~/.gmqcc/testsuite
70 if [ ! -d ~/.gmqcc/testsuite/projects ]; then
71 mkdir -p ~/.gmqcc/testsuite/projects
73 cd ~/.gmqcc/testsuite/projects
74 echo "$(ls ../ | cat | grep -v '^hashes$' | grep -v '^projects$' | grep -v '^options$')" | while read -r line
76 echo "extracting project $line"
77 mkdir "$(echo "$line" | sed 's/\(.*\)\..*/\1/')"
78 unzip -qq "../$line" -d $(echo "$line" | sed 's/\(.*\)\..*/\1/')
82 echo "previous state exists, using it"
85 # compile projects in those directories
87 env -i type gmqcc 1>/dev/null 2>&1 || {
88 if [ -f ../gmqcc ]; then
89 echo "previous build of gmqcc exists, using it"
90 gmqcc_bin="$(pwd)/../gmqcc"
91 elif [ -f ./gmqcc ]; then
92 echo "previous build of gmqcc exists, using it"
93 gmqcc_bin="$(pwd)/gmqcc"
95 echo "gmqcc not installed and previous build doesn't exist"
96 echo "please run make, or make install"
102 cd ~/.gmqcc/testsuite/projects
104 find . -maxdepth 1 -mindepth 1 -type d | while read -r line
107 echo -n "compiling $line... "
108 cd "${start}/${line}"
110 # does the project have multiple subprojects?
113 cat dirs | while read -r dir
115 # change to subproject
116 echo -n " compiling $dir... "
119 cmd="$(cat ../../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}')"
120 "$gmqcc_bin" $cmd > /dev/null 2>&1
121 if [ $? -ne 0 ]; then
128 # nope only one project
130 echo "$gmqcc_bin" $(cat ../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}')
131 cmd="$(cat ../../options | grep "$line:" | awk '{print substr($0, index($0, $2))}')"
132 "$gmqcc_bin" $cmd > /dev/null 2>&1
133 if [ $? -ne 0 ]; then