New tesseract daily build

Started by Anonymouse, November 25, 2012, 11:05:42 PM

Previous topic - Next topic

Anonymouse

Hi everyone, I've set up another place with daily builds of tesseract.
http://rru-stuff.org/tesseract-daily/

It may well download faster than here from mapping hell (I got 200kbps max from here and some 500 from mine).

I also modified (dare I say improved?) the script for building and archiving it a little.


#!/bin/bash -x

OUTPUT_DIR=/home/linus/www/tesseract-daily/

(cd sauerbraten && svn up)

cd tesseract
git pull origin master

rm -f $OUTPUT_DIR/tesseract*-daily-*
OUTPUT_PREFIX=`date +%Y-%m-%d`-`git rev-parse --short HEAD`

(cd src && make clean clean-enet && make install)
7z a -mmt0 -l -xr!?git/* -x!sauerbraten -x!server-init.cfg -x!src $OUTPUT_DIR/tesseract-daily-${OUTPUT_PREFIX}.7z *
cp $OUTPUT_DIR/tesseract-daily-${OUTPUT_PREFIX}.7z /tmp/withdata.7z
cd ../sauerbraten/
7z a -mmt0 -l -xr!?git/* -xr!?svn/* -x!server-init.cfg /tmp/withdata.7z packages
cp /tmp/withdata.7z $OUTPUT_DIR/tesseract-with-data-daily-${OUTPUT_PREFIX}.7z

cd ../tesseract
(cd src && make clean clean-enet && make CXX=i586-mingw32msvc-g++ STRIP=i586-mingw32msvc-strip WINDRES=i586-mingw32msvc-windres LD=i586-mingw32msvc-ld PLATFORM=MINGW install)
7z a -mmt0 -l -xr!?git/* -x!sauerbraten -x!server-init.cfg -x!src $OUTPUT_DIR/tesseract-daily-win32-${OUTPUT_PREFIX}.7z *
cp $OUTPUT_DIR/tesseract-daily-win32-${OUTPUT_PREFIX}.7z /tmp/withdata.7z
cd ../sauerbraten/
7z a -mmt0 -l -xr!?git/* -xr!?svn/* -x!server-init.cfg /tmp/withdata.7z packages
cp /tmp/withdata.7z $OUTPUT_DIR/tesseract-with-data-daily-win32-${OUTPUT_PREFIX}.7z

rm /tmp/withdata.7z


I modified it to use only one core (remove -mmt0 and add back -j 2 to put that back) and work more efficiently (only compress tesseract once).

vampirefrog

Nice.

To make it even more efficient, compress sauerbraten folder once, and on the next runs only re-archive if the svn revision has changed.

Anonymouse

I was going to do that but checking became too ugly for me (as far as I know you'd have to check if $(svn up) begins with "At revision"...
Git would have been less of a pain because it simply always says "Already up-to-date" and I did implement it at first but... whatever :P

vampirefrog

Use

svn info | grep Revision | sed -e "s/Revision: //"

to get the revision before and after svn up

and just compare later in the script.

Anonymouse

Hmmm, I guess... Maybe I'll do that eventually.

Actually, whether svn updated can be determined simply by wc -l... if [ $(svn up | wc -l) != 1 ] ; then flablabupdatethearchive ; done

Anonymouse

 :rockin:

#!/bin/bash -x

OUTPUT_DIR=/home/linus/www/tesseract-daily/

cd sauerbraten
[ $(svn up | wc -l) != 1 ] && resauer=1
cd ..

cd tesseract
[ "$(git pull origin master | tail -n 1)" = "Already up-to-date." ] || retess=1

[ -z "$retess$resauer" ] && ( echo "No action necessary." ; exit 0 )

rm -f $OUTPUT_DIR/tesseract*-daily-*
OUTPUT_PREFIX=`date +%Y-%m-%d`-`git rev-parse --short HEAD`

cd ../tesseract
if [ -n "$retess" ] ; then
(cd src && make clean clean-enet && make -s CXX=i586-mingw32msvc-g++ STRIP=i586-mingw32msvc-strip WINDRES=i586-mingw32msvc-windres LD=i586-mingw32msvc-ld PLATFORM=MINGW install)
fi
7z a -mmt0 -l -xr!?git/* -x!sauerbraten -x!server-init.cfg -x!src $OUTPUT_DIR/tesseract-daily-win32-${OUTPUT_PREFIX}.7z *
cp $OUTPUT_DIR/tesseract-daily-win32-${OUTPUT_PREFIX}.7z /tmp/withdata.7z
cd ../sauerbraten/
7z a -mmt0 -l -xr!?git/* -xr!?svn/* -x!server-init.cfg /tmp/withdata.7z packages
cp /tmp/withdata.7z $OUTPUT_DIR/tesseract-with-data-daily-win32-${OUTPUT_PREFIX}.7z

rm /tmp/withdata.7z

Mission complete! Yay for hacky code... To be expected I guess, it's bash after all.