download_options=$(wget -qO- ${options})
download() {
- pushd ~/.gmqcc/testsuite >> /dev/null
+ pushd ~/.gmqcc/testsuite > /dev/null
echo "$download_list" | while read -r line
do
echo "downloading $line ..."
echo "$download_hashes" > ~/.gmqcc/testsuite/hashes
echo "$download_options" > ~/.gmqcc/testsuite/options
- popd >> /dev/null
+ popd > /dev/null
}
if [ -z "$download_list" -o -z "$download_hashes" -o -z "$download_options" ]; then
echo "$download_hashes" > /tmp/gmqcc_download_hashes
echo "$download_options" > /tmp/gmqcc_download_options
- diff -u ~/.gmqcc/testsuite/hashes /tmp/gmqcc_download_hashes >> /dev/null
+ diff -u ~/.gmqcc/testsuite/hashes /tmp/gmqcc_download_hashes > /dev/null
check_hash=$?
- diff -u ~/.gmqcc/testsuite/options /tmp/gmqcc_download_options >> /dev/null
+ diff -u ~/.gmqcc/testsuite/options /tmp/gmqcc_download_options > /dev/null
check_opts=$?
if [ $check_hash -ne 0 -o $check_opts -ne 0 ]; then
if [ ! -d ~/.gmqcc/testsuite/projects ]; then
mkdir -p ~/.gmqcc/testsuite/projects
- pushd ~/.gmqcc/testsuite/projects >> /dev/null
- echo "$(ls ../ | cat | grep -v '^hashes$' | grep -v '^projects$')" | while read -r line
+ pushd ~/.gmqcc/testsuite/projects > /dev/null
+ echo "$(ls ../ | cat | grep -v '^hashes$' | grep -v '^projects$' | grep -v '^options$')" | while read -r line
do
echo "extracting project $line"
mkdir "$(echo "$line" | sed 's/\(.*\)\..*/\1/')"
unzip -qq "../$line" -d $(echo "$line" | sed 's/\(.*\)\..*/\1/')
done
- popd >> /dev/null
+ popd > /dev/null
else
echo "previous state exists, using it"
fi
fi
}
-pushd ~/.gmqcc/testsuite/projects >> /dev/null
+pushd ~/.gmqcc/testsuite/projects > /dev/null
find . -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | while read -r line
do
+ error=0
echo -n "compiling $line... "
- pushd "$line" >> /dev/null
- "$gmqcc_bin" $(cat ../../options | grep "$line:" | awk '{print $2}') > /dev/null 2>&1
- if [ $? -ne 0 ]; then
+ pushd "$line" > /dev/null
+
+ # does the project have multiple subprojects?
+ if [ -f dirs ]; then
+ cat dirs | while read -r dir
+ do
+ # change to subproject
+ pushd "$dir" > /dev/null
+ "$gmqcc_bin" $(cat ../../../options | grep "$line:" | awk '{print $2}') > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ error=1
+ fi
+ popd > /dev/null
+ done
+ # nope only one project
+ else
+ "$gmqcc_bin" $(cat ../../options | grep "$line:" | awk '{print $2}') > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ error=1
+ fi
+ fi
+
+ # status
+ if [ $error -ne 0 ]; then
echo "error"
else
echo "success"
fi
- popd >> /dev/null
+ popd > /dev/null
done
-popd >> /dev/null
+
+popd > /dev/null
pushd qcsrc > /dev/null
if [ ! -d client -o ! -d common -o ! -d dpdefs -o ! -d menu -o ! -d server -o ! -d warpzonelib ]; then
echo "this doesnt look like a xonotic source tree, aborting"
- popd >> /dev/null
+ popd > /dev/null
exit 1
fi
fi
echo "complete"
fi
-echo -n "removing redundant files ... "
-rm -f autocvarize.pl
+echo -n "removing redundant files ..."
+rm -f Makefile
rm -f autocvarize-update.sh
+rm -f autocvarize.pl
rm -f collect-precache.sh
rm -f fteqcc-bugs.qc
rm -f i18n-badwords.txt
rm -f i18n-guide.txt
-rm -rf server-testcase
-rm -f Makefile
-rm -f *.src
-rm -f qccversion.*
echo "complete"
-cat client/progs.src | sed "s/\.\.\///" > client.src
-cat server/progs.src | sed "s/\.\.\///" > server.src
-cat menu/progs.src | sed "s/\.\.\///" > menu.src
+echo -n "creating projects ..."
+echo "client" > dirs
+echo "server" >> dirs
+echo "menu" >> dirs
-echo "creating zip archives..."
-cp client.src progs.src
-cat progs.src | zip ../xonotic-client.zip -@ > /dev/null
-cp server.src progs.src
-cat progs.src | zip ../xonotic-server.zip -@ > /dev/null
-cp menu.src progs.src
-cat progs.src | zip ../xonotic-menu.zip -@ > /dev/null
-rm client.src server.src menu.src progs.src
+echo "complete"
+echo -n "creating zip archive ..."
+zip -r -9 ../xonotic.zip * > /dev/null
echo "complete"
popd > /dev/null