summaryrefslogtreecommitdiff
path: root/.tools
diff options
context:
space:
mode:
Diffstat (limited to '.tools')
-rwxr-xr-x.tools/contributors.sh3
-rwxr-xr-x.tools/deploy.sh36
-rwxr-xr-x.tools/downloadlib.sh6
-rwxr-xr-x.tools/imagemagiccheck.sh3
-rwxr-xr-x.tools/init.sh58
-rwxr-xr-x.tools/licensecheck.sh3
-rwxr-xr-x.tools/manaplus.sh8
-rwxr-xr-x.tools/retry.sh15
-rwxr-xr-x.tools/testxml.sh5
9 files changed, 45 insertions, 92 deletions
diff --git a/.tools/contributors.sh b/.tools/contributors.sh
index cbfadf1b..8b85eeea 100755
--- a/.tools/contributors.sh
+++ b/.tools/contributors.sh
@@ -5,7 +5,8 @@ source ./.tools/init.sh
clientdata_init
aptget_update
-aptget_install git-core gcc ca-certificates libxml2-utils make xsltproc
+aptget_install git-core make xsltproc
+
rm -rf tools
gitclone https://git.themanaworld.org/evolved tools.git tools
diff --git a/.tools/deploy.sh b/.tools/deploy.sh
deleted file mode 100755
index 82b8c292..00000000
--- a/.tools/deploy.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-source ./.tools/init.sh
-
-clientdata_init
-
-aptget_update
-aptget_install git-core zip gcc zlib1g-dev ca-certificates libxml2-utils python
-rm -rf tools
-gitclone https://git.themanaworld.org/evolved tools.git tools
-
-cd clientdata
-rm -rf public
-mkdir public
-
-cd ..
-
-# FIXME
-#rm -rf music
-#gitclone https://git.themanaworld.org/evolved music.git music
-
-cd tools/update
-
-# FIXME
-./createnew.sh
-check_error $?
-#./create_music.sh
-#check_error $?
-
-cp -r upload/* ../../clientdata/public
-cd ../../clientdata
-gitclone https://git.themanaworld.org/mana pagesindexgen.git pagesindexgen
-cd pagesindexgen
-./pagesindexgen.py ../public
-check_error $?
-ls ../public
diff --git a/.tools/downloadlib.sh b/.tools/downloadlib.sh
index c1aff5a4..2e27ba80 100755
--- a/.tools/downloadlib.sh
+++ b/.tools/downloadlib.sh
@@ -6,7 +6,11 @@ export libname="$1_$2"
mkdir libdownload
cd libdownload
rm "${zipname}"
-../client-data/.tools/retry.sh wget -O "${zipname}" "https://git.themanaworld.org/mana/spm/builds/artifacts/$1/download?job=${libname}"
+
+wget --retry-connrefused --retry-on-host-error --tries=10 --waitretry=5 \
+ -O "$zipname" \
+ "https://git.themanaworld.org/mana/spm/builds/artifacts/$1/download?job=${libname}"
+
unzip "${zipname}"
cp -r "bin/${libname}" ..
cd ..
diff --git a/.tools/imagemagiccheck.sh b/.tools/imagemagiccheck.sh
index 34621cdd..a7e8e481 100755
--- a/.tools/imagemagiccheck.sh
+++ b/.tools/imagemagiccheck.sh
@@ -5,7 +5,8 @@ source ./.tools/init.sh
clientdata_init
aptget_update
-aptget_install git-core gcc ca-certificates imagemagick
+aptget_install git-core imagemagick
+
rm -rf tools
gitclone https://git.themanaworld.org/evolved tools.git tools
diff --git a/.tools/init.sh b/.tools/init.sh
index 4fe533ef..01a6d3d5 100755
--- a/.tools/init.sh
+++ b/.tools/init.sh
@@ -7,6 +7,30 @@ function check_error {
fi
}
+retry_with_increasing_wait()
+{
+ local wait_time=1
+
+ while true; do
+ "$@"
+ local retval=$?
+
+ if [[ $retval -eq 0 || $wait_time -gt 16 ]]; then
+ break
+ fi
+
+ printf "command %s failed (exit code %d), waiting %d seconds until next try.\n"\
+ "$*" "$retval" "$wait_time"
+
+ sleep "$wait_time"
+ # 1, 2, 4, 8, 16...
+ (( wait_time = 2 * wait_time ))
+ done
+
+ return "$retval"
+}
+
+
function gitclone1 {
echo git clone $2 $3
git clone $2 $3
@@ -23,19 +47,7 @@ function gitclone {
export name2=${CI_BUILD_REPO##*@}
export name2=https://${name2%/*}/$2
- gitclone1 "$name1" "$name2" $3
- if [ "$?" != 0 ]; then
- sleep 1s
- gitclone1 "$name1" "$name2" $3
- if [ "$?" != 0 ]; then
- sleep 3s
- gitclone1 "$name1" "$name2" $3
- if [ "$?" != 0 ]; then
- sleep 5s
- gitclone1 "$name1" "$name2" $3
- fi
- fi
- fi
+ retry_with_increasing_wait gitclone1 "$name1" "$name2" "$3"
check_error $?
}
@@ -57,28 +69,12 @@ function update_repos {
function aptget_update {
update_repos
- apt-get update
- if [ "$?" != 0 ]; then
- sleep 1s
- apt-get update
- if [ "$?" != 0 ]; then
- sleep 1s
- apt-get update
- fi
- fi
+ retry_with_increasing_wait apt-get update
check_error $?
}
function aptget_install {
- apt-get -y -qq install $*
- if [ "$?" != 0 ]; then
- sleep 1s
- apt-get -y -qq install $*
- if [ "$?" != 0 ]; then
- sleep 2s
- apt-get -y -qq install $*
- fi
- fi
+ retry_with_increasing_wait apt-get -y -qq install $*
check_error $?
}
diff --git a/.tools/licensecheck.sh b/.tools/licensecheck.sh
index ba2be45f..412b4def 100755
--- a/.tools/licensecheck.sh
+++ b/.tools/licensecheck.sh
@@ -5,7 +5,8 @@ source ./.tools/init.sh
clientdata_init
aptget_update
-aptget_install git-core gcc ca-certificates grep
+aptget_install git-core grep
+
rm -rf tools
gitclone https://git.themanaworld.org/evolved tools.git tools
diff --git a/.tools/manaplus.sh b/.tools/manaplus.sh
index aeb39a86..239696c9 100755
--- a/.tools/manaplus.sh
+++ b/.tools/manaplus.sh
@@ -5,10 +5,10 @@ source ./.tools/init.sh
clientdata_init
aptget_update
-aptget_install gcc g++ \
- make autoconf automake autopoint gettext \
- libxml2-dev libcurl4-gnutls-dev libpng-dev \
- libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev \
+# Evidently libcurl3-gnutls ships libcurl4-gnutls.so.4
+aptget_install \
+ libcurl3-gnutls \
+ libsdl-gfx1.2 libsdl-image1.2 libsdl-mixer1.2 libsdl-net1.2 libsdl-ttf2.0 \
wget unzip
pwd
diff --git a/.tools/retry.sh b/.tools/retry.sh
deleted file mode 100755
index aaa50e98..00000000
--- a/.tools/retry.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-n=0
-
-while true; do
- $*
- if [ "$?" == 0 ]; then
- exit 0
- fi
- if [[ $n -ge 10 ]]; then
- exit -1
- fi
- sleep 5s
- n=$((n+1))
-done
diff --git a/.tools/testxml.sh b/.tools/testxml.sh
index a0dc16b3..458d7b85 100755
--- a/.tools/testxml.sh
+++ b/.tools/testxml.sh
@@ -5,7 +5,8 @@ source ./.tools/init.sh
clientdata_init
aptget_update
-aptget_install git-core zip gcc zlib1g-dev ca-certificates libxml2-utils python python-pyvorbis python-ogg python-pil
+aptget_install git-core libxml2-utils python python-pil python-pyvorbis
+
rm -rf tools
gitclone https://git.themanaworld.org/evolved tools.git tools
@@ -16,7 +17,7 @@ check_error $?
export RES=$(cat errors.txt)
if [[ -n "${RES}" ]]; then
echo "xml check failed" >../../../clientdata/shared/error.log
- echo ${RES} >>../../../clientdata/shared/error.log
+ cat errors.txt >>../../../clientdata/shared/error.log
cat ../../../clientdata/shared/error.log
exit 1
fi