From 39ae9e1b08a9f49a61f413f9b8b579e91ffcf496 Mon Sep 17 00:00:00 2001 From: mathusummut Date: Sat, 10 Nov 2018 14:14:26 +0100 Subject: [PATCH] Split script in two file --- mk/linux/build-deps.sh | 1 - mk/linux/build-zg-nodeps.sh | 7 +++++-- mk/linux/build-zg.sh | 1 + mk/linux/clone-data.sh | 16 ++++++++++++++++ mk/linux/setup.sh | 16 ++-------------- 5 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 mk/linux/clone-data.sh diff --git a/mk/linux/build-deps.sh b/mk/linux/build-deps.sh index ee1db98a3..dfd2c7c53 100755 --- a/mk/linux/build-deps.sh +++ b/mk/linux/build-deps.sh @@ -7,7 +7,6 @@ # Copyright (c) 2012-2017 Mark Vejvoda, Tom Reynolds under GNU GPL v3.0 LANG=C -echo echo "Installing required dependencies...(requires root)" echo diff --git a/mk/linux/build-zg-nodeps.sh b/mk/linux/build-zg-nodeps.sh index 72730ab84..daa58c796 100755 --- a/mk/linux/build-zg-nodeps.sh +++ b/mk/linux/build-zg-nodeps.sh @@ -8,7 +8,7 @@ # # Configuration section # -echo + echo "Building ZetaGlest..." echo @@ -320,8 +320,11 @@ else if [ $? -ne 0 ]; then echo 'ERROR: MAKE failed.' >&2; exit 2 fi - + cd .. + if [ `id -u`'x' == '0x' ] || [ "$1" == "--manually" ]; then + chmod -R 777 build/ + fi echo '' echo 'BUILD COMPLETE.' echo '' diff --git a/mk/linux/build-zg.sh b/mk/linux/build-zg.sh index d266ea4d4..7007a11ad 100755 --- a/mk/linux/build-zg.sh +++ b/mk/linux/build-zg.sh @@ -5,4 +5,5 @@ # Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+ ./build-deps.sh +echo ./build-zg-nodeps.sh diff --git a/mk/linux/clone-data.sh b/mk/linux/clone-data.sh new file mode 100644 index 000000000..003ac3205 --- /dev/null +++ b/mk/linux/clone-data.sh @@ -0,0 +1,16 @@ +#!/bin/bash +echo "Downloading game data..." +currentDir=$PWD +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +cd $DIR +mkdir build +cd build +git clone https://github.com/ZetaGlest/zetaglest-data.git data +cd .. + +if [ `id -u`'x' == '0x' ] || [ "$1" == "--manually" ]; then + chmod -R 777 build/ +fi + +cd $currentDir diff --git a/mk/linux/setup.sh b/mk/linux/setup.sh index 58491aabb..d93af524b 100755 --- a/mk/linux/setup.sh +++ b/mk/linux/setup.sh @@ -1,20 +1,8 @@ #!/bin/bash -# Use this script to build ZetaGlest using cmake -# ---------------------------------------------------------------------------- -# Written by Mark Vejvoda -# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+ echo echo "Initializing ZetaGlest setup..." -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -cd $DIR +./clone-data.sh echo -echo "Downloading game data..." -mkdir build -cd build -git clone https://github.com/ZetaGlest/zetaglest-data.git data -cd .. ./pull.sh +echo ./build-zg.sh -if [ `id -u`'x' == '0x' ] || [ "$1" == "--manually" ]; then - chmod -R 777 build/ -fi