diff --git a/.travis.yml b/.travis.yml index c90276540..98534a11a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ matrix: - g++-4.8 before_install: - export DF_VERSION=$(sh travis/get-df-version.sh) -- export DF_FOLDER="$HOME/DF-travis/$DF_VERSION" +- export DF_FOLDER="$HOME/DF-travis/$DF_VERSION/df_linux" - pip install --user "sphinx==1.4" "requests[security]" - sh travis/build-lua.sh - sh travis/download-df.sh @@ -56,9 +56,7 @@ script: - python travis/check-rpc.py "$DF_FOLDER/dfhack-rpc.txt" before_cache: - cat "$DF_FOLDER/stderr.log" -- rm -rf "$DF_FOLDER/hack" -- rm -rf "$DF_FOLDER/dfhack-config" -- rm -f "$DF_FOLDER"/*.log +- rm -rf "$DF_FOLDER" notifications: email: false irc: diff --git a/travis/download-df.sh b/travis/download-df.sh index 20dc3dbd4..4eae6f9b9 100755 --- a/travis/download-df.sh +++ b/travis/download-df.sh @@ -10,31 +10,37 @@ cd "$(dirname "$0")" echo "DF_VERSION: $DF_VERSION" echo "DF_FOLDER: $DF_FOLDER" mkdir -p "$DF_FOLDER" -cd "$DF_FOLDER" +# back out of df_linux +cd "$DF_FOLDER/.." if [ -f receipt ]; then if [ "$selfmd5" != "$(cat receipt)" ]; then echo "download-df.sh changed; removing DF" + rm receipt else echo "Already downloaded $DF_VERSION" - exit 0 fi fi -rm -rif "$tardest" df_linux +if [ ! -f receipt ]; then + rm -f "$tardest" + minor=$(echo "$DF_VERSION" | cut -d. -f2) + patch=$(echo "$DF_VERSION" | cut -d. -f3) + url="http://www.bay12games.com/dwarves/df_${minor}_${patch}_linux.tar.bz2" + echo Downloading + wget "$url" -O "$tardest" +fi -minor=$(echo "$DF_VERSION" | cut -d. -f2) -patch=$(echo "$DF_VERSION" | cut -d. -f3) -url="http://www.bay12games.com/dwarves/df_${minor}_${patch}_linux.tar.bz2" +rm -rf df_linux +mkdir df_linux -echo Downloading -wget "$url" -O "$tardest" echo Extracting -tar xf "$tardest" --strip-components=1 +tar xf "$tardest" --strip-components=1 -C df_linux echo Changing settings -echo '' >> "$DF_FOLDER/data/init/init.txt" -echo '[PRINT_MODE:TEXT]' >> "$DF_FOLDER/data/init/init.txt" -echo '[SOUND:NO]' >> "$DF_FOLDER/data/init/init.txt" +echo '' >> "df_linux/data/init/init.txt" +echo '[PRINT_MODE:TEXT]' >> "df_linux/data/init/init.txt" +echo '[SOUND:NO]' >> "df_linux/data/init/init.txt" echo Done echo "$selfmd5" > receipt +ls diff --git a/travis/get-df-version.sh b/travis/get-df-version.sh index 13d317d2e..24386252d 100755 --- a/travis/get-df-version.sh +++ b/travis/get-df-version.sh @@ -1,4 +1,4 @@ #!/bin/sh cd "$(dirname "$0")" cd .. -grep DF_VERSION CMakeLists.txt | perl -ne 'print "$&\n" if /[\d\.]+/' +grep -i 'set(DF_VERSION' CMakeLists.txt | perl -ne 'print "$&\n" if /[\d\.]+/' diff --git a/travis/run-tests.py b/travis/run-tests.py index ae48074b5..a66320f37 100644 --- a/travis/run-tests.py +++ b/travis/run-tests.py @@ -14,6 +14,9 @@ os.chdir(sys.argv[1]) if os.path.exists(test_stage): os.remove(test_stage) +print(os.getcwd()) +print(os.listdir('.')) + tries = 0 while True: tries += 1 @@ -33,3 +36,5 @@ while True: process = subprocess.Popen([dfhack], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) process.communicate() + if process.returncode != 0: + print('DF exited with ' + repr(process.returncode))