commit
3599403f21
@ -1,52 +1,50 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
DF_FOLDER=$1
|
||||||
|
OS_TARGET=$2
|
||||||
|
DF_VERSION=$3
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
df_tardest="df.tar.bz2"
|
minor=$(echo "$DF_VERSION" | cut -d. -f1)
|
||||||
save_tardest="test_save.tgz"
|
patch=$(echo "$DF_VERSION" | cut -d. -f2)
|
||||||
|
df_url="https://www.bay12games.com/dwarves/df_${minor}_${patch}"
|
||||||
cd "$(dirname "$0")"
|
if test "$OS_TARGET" = "windows"; then
|
||||||
echo "DF_VERSION: $DF_VERSION"
|
WGET="C:/msys64/usr/bin/wget.exe"
|
||||||
echo "DF_FOLDER: $DF_FOLDER"
|
df_url="${df_url}_win_s.zip"
|
||||||
mkdir -p "$DF_FOLDER"
|
df_archive_name="df.zip"
|
||||||
# back out of df_linux
|
df_extract_cmd="unzip -d ${DF_FOLDER}"
|
||||||
cd "$DF_FOLDER/.."
|
elif test "$OS_TARGET" = "ubuntu"; then
|
||||||
|
WGET=wget
|
||||||
if ! test -f "$df_tardest"; then
|
df_url="${df_url}_linux.tar.bz2"
|
||||||
minor=$(echo "$DF_VERSION" | cut -d. -f2)
|
df_archive_name="df.tar.bz2"
|
||||||
patch=$(echo "$DF_VERSION" | cut -d. -f3)
|
df_extract_cmd="tar -x -j --strip-components=1 -f"
|
||||||
echo "Downloading DF $DF_VERSION"
|
else
|
||||||
while read url; do
|
echo "Unhandled OS target: ${OS_TARGET}"
|
||||||
echo "Attempting download: ${url}"
|
exit 1
|
||||||
if wget -v "$url" -O "$df_tardest"; then
|
fi
|
||||||
break
|
|
||||||
fi
|
if ! $WGET -v "$df_url" -O "$df_archive_name"; then
|
||||||
done <<URLS
|
echo "Failed to download DF from $df_url"
|
||||||
https://www.bay12games.com/dwarves/df_${minor}_${patch}_linux.tar.bz2
|
exit 1
|
||||||
https://files.dfhack.org/DF/${minor}.${patch}/df_${minor}_${patch}_linux.tar.bz2
|
|
||||||
URLS
|
|
||||||
echo $df_tardest
|
|
||||||
if ! test -f "$df_tardest"; then
|
|
||||||
echo "DF failed to download: $df_tardest not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Downloading test save"
|
|
||||||
#test_save_url="https://files.dfhack.org/DF/0.${minor}.${patch}/test_save.tgz"
|
|
||||||
test_save_url="https://drive.google.com/uc?export=download&id=1XvYngl-DFONiZ9SD9OC4B2Ooecu8rPFz"
|
|
||||||
if ! wget -v "$test_save_url" -O "$save_tardest"; then
|
|
||||||
echo "failed to download test save"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo $save_tardest
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf df_linux
|
save_url="https://dffd.bay12games.com/download.php?id=15434&f=dreamfort.7z"
|
||||||
mkdir -p df_linux/save
|
save_archive_name="test_save.7z"
|
||||||
|
save_extract_cmd="7z x -oDF/save"
|
||||||
|
|
||||||
|
if ! $WGET -v "$save_url" -O "$save_archive_name"; then
|
||||||
|
echo "Failed to download test save from $save_url"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo Extracting
|
echo Extracting
|
||||||
tar xf "$df_tardest" --strip-components=1 -C df_linux
|
$df_extract_cmd "$df_archive_name"
|
||||||
tar xf "$save_tardest" -C df_linux/save
|
$save_extract_cmd "$save_archive_name"
|
||||||
|
mv DF/save/* DF/save/region1
|
||||||
|
|
||||||
echo Done
|
echo Done
|
||||||
|
|
||||||
ls -l
|
ls -l
|
||||||
|
|
||||||
|
md5sum "$df_archive_name" "$save_archive_name"
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
config.targets = 'core'
|
||||||
|
|
||||||
function test.internal_in_test()
|
function test.internal_in_test()
|
||||||
expect.true_(dfhack.internal.IN_TEST)
|
expect.true_(dfhack.internal.IN_TEST)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue