From b08ccd001ebe0edd8a2beea73be41f270a35ec7e Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 30 Dec 2018 17:47:10 -0500 Subject: [PATCH 1/5] travis: Always clear DF folder --- .travis.yml | 6 ++---- travis/download-df.sh | 27 ++++++++++++++++----------- 2 files changed, 18 insertions(+), 15 deletions(-) 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..44426de54 100755 --- a/travis/download-df.sh +++ b/travis/download-df.sh @@ -15,26 +15,31 @@ 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_FOLDER/df_linux/data/init/init.txt" +echo '[PRINT_MODE:TEXT]' >> "$DF_FOLDER/df_linux/data/init/init.txt" +echo '[SOUND:NO]' >> "$DF_FOLDER/df_linux/data/init/init.txt" echo Done echo "$selfmd5" > receipt +ls From 8063717503a4d97c3b8bf90e543dc99b3122c8a5 Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 2 Jan 2019 17:05:28 -0500 Subject: [PATCH 2/5] get-df-version: make filter more strict --- travis/get-df-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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\.]+/' From 13dfa130d72a7370d0f1e0c17f9abf3a794c54cc Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 2 Jan 2019 17:34:08 -0500 Subject: [PATCH 3/5] Add more diagnostics to run-tests.py --- travis/run-tests.py | 5 +++++ 1 file changed, 5 insertions(+) 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)) From 966389703796d497894288370d94b1533a869e3b Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 2 Jan 2019 18:40:34 -0500 Subject: [PATCH 4/5] Fix inconsistency resulting in nested df_linux folders --- travis/download-df.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/travis/download-df.sh b/travis/download-df.sh index 44426de54..cedb843b9 100755 --- a/travis/download-df.sh +++ b/travis/download-df.sh @@ -11,6 +11,8 @@ echo "DF_VERSION: $DF_VERSION" echo "DF_FOLDER: $DF_FOLDER" mkdir -p "$DF_FOLDER" cd "$DF_FOLDER" +# back out of df_linux +cd .. if [ -f receipt ]; then if [ "$selfmd5" != "$(cat receipt)" ]; then @@ -36,9 +38,9 @@ mkdir df_linux echo Extracting tar xf "$tardest" --strip-components=1 -C df_linux echo Changing settings -echo '' >> "$DF_FOLDER/df_linux/data/init/init.txt" -echo '[PRINT_MODE:TEXT]' >> "$DF_FOLDER/df_linux/data/init/init.txt" -echo '[SOUND:NO]' >> "$DF_FOLDER/df_linux/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 From 703e1b8a0cc700ec45fe638582db20dd55338660 Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 2 Jan 2019 19:15:19 -0500 Subject: [PATCH 5/5] Consolidate cd commands --- travis/download-df.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/travis/download-df.sh b/travis/download-df.sh index cedb843b9..4eae6f9b9 100755 --- a/travis/download-df.sh +++ b/travis/download-df.sh @@ -10,9 +10,8 @@ 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 .. +cd "$DF_FOLDER/.." if [ -f receipt ]; then if [ "$selfmd5" != "$(cat receipt)" ]; then