4 location=${host}"/files"
5 list=${location}"/files"
6 hashes=${location}"/hashes"
8 #download required things
9 download_list=$(wget -qO- ${list})
10 download_hashes=$(wget -qO- ${hashes})
13 pushd ~/.gmqcc/testsuite >> /dev/null
14 echo "$download_list" | while read -r line
16 echo "downloading $line ..."
17 wget -q "${location}/$line"
20 echo "$download_hashes" > ~/.gmqcc/testsuite/hashes
24 if [ -z "$download_list" -o -z "$download_hashes" ]; then
25 echo "failed to download required information to check projects."
27 if [ "$(ping -q -c1 "${host}")" ]; then
28 echo "host ${host} seems to be up but missing required files."
29 echo "please file bug report at: github.com/graphitemaster/gmqcc"
31 echo "host ${host} seems to be down, please try again later."
38 # we have existing contents around
39 if [ -f ~/.gmqcc/testsuite/hashes ]; then
40 echo "$download_hashes" > /tmp/gmqcc_download_hashes
41 diff -u ~/.gmqcc/testsuite/hashes /tmp/gmqcc_download_hashes >> /dev/null
43 echo "consistency errors in hashes (possible update), obtaining fresh contents"
44 rm -rf ~/.gmqcc/testsuite/projects
45 rm ~/.gmqcc/testsuite/*.zip
50 # do we even have the directory
51 echo "preparing project testsuite for the first time"
52 if [ ! -d ~/.gmqcc/testsuite ]; then
53 mkdir -p ~/.gmqcc/testsuite
59 if [ ! -d ~/.gmqcc/testsuite/projects ]; then
60 mkdir -p ~/.gmqcc/testsuite/projects
61 pushd ~/.gmqcc/testsuite/projects >> /dev/null
62 echo "$(ls ../ | cat | grep -v '^hashes$' | grep -v '^projects$')" | while read -r line
64 echo "extracting project $line"
65 mkdir "$(echo "$line" | sed 's/\(.*\)\..*/\1/')"
66 unzip -qq "../$line" -d $(echo "$line" | sed 's/\(.*\)\..*/\1/')
70 echo "previous state exists, using it"
73 # compile projects in those directories
74 pushd ~/.gmqcc/testsuite/projects >> /dev/null
75 find . -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | while read -r line
77 echo -n "compiling $line..."
78 pushd "$line" >> /dev/null
79 gmqcc -std=qcc >> /dev/null