build.cfg: Add BUILD_UPDATE, which will control whether or not to run a vcs update command before building a project

This commit is contained in:
Marco Cawthorne 2021-08-07 12:27:19 +02:00
parent e50cf421e6
commit 4bebda7940
5 changed files with 36 additions and 9 deletions

View File

@ -27,3 +27,6 @@ BUILD_IMGTOOL=1
# Specify which engine revision to build, these are considered 'stable'
BUILD_ENGINEREVISION=5997
# Whether or not to run 'git pull' or 'svn up' before building a component
BUILD_UPDATE=1

View File

@ -45,9 +45,13 @@ fi
mkdir -p ./bin
if [ -f "$WS_MAKEFILE" ]; then
printf "WorldSpawn is present, updating...\n"
cd ./src/worldspawn/
git pull
if [ "$BUILD_UPDATE" -eq 1 ]; then
printf "WorldSpawn is present, updating...\n"
cd ./src/worldspawn/
git pull
else
cd ./src/worldspawn/
fi
else
printf "WorldSpawn is NOT present, cloning...\n"
cd ./src/

View File

@ -59,10 +59,14 @@ fi
mkdir -p ./bin
if [ -f "$FTE_MAKEFILE" ]; then
printf "Engine is present, updating...\n"
cd ./src/engine/
svn -r $BUILD_ENGINEREVISION up
cd ./engine
if [ "$BUILD_UPDATE" -eq 1 ]; then
printf "Engine is present, updating...\n"
cd ./src/engine/
svn -r $BUILD_ENGINEREVISION up
cd ./engine
else
cd ./src/engine/engine
fi
else
printf "Engine is NOT present, cloning...\n"
cd ./src/

View File

@ -4,12 +4,17 @@ set -e
SCRPATH="$( cd "$( dirname $(readlink -nf $0) )" && pwd )"
PATH="$SCRPATH"/bin:"$PATH"
if [ -f "$SCRPATH"/bin/fteqcc ]; then
# We want to compile a specific game
if [ $# -gt 0 ]; then
cd "$SCRPATH/$1"/src
if [ "$BUILD_UPDATE" -eq 1 ]; then
# git pull on the main repo
git pull
fi
make
cd "$SCRPATH"
./make_mapdef.sh "$1"
@ -21,8 +26,14 @@ if [ -f "$SCRPATH"/bin/fteqcc ]; then
make
cd "$OLDDIR"
if [ "$BUILD_UPDATE" -eq 1 ]; then
# git pull on the main repo
git pull
fi
find "$SCRPATH" -name Makefile | grep 'src\/Makefile' | grep -v engine | grep -v worldspawn | while read MFILE_N; do
cd $(dirname $MFILE_N)
git pull
make
cd ..
export GAMEDIR=$(basename $PWD)

View File

@ -1,4 +1,5 @@
#!/bin/sh
. ./build.cfg
set -e
SCRPATH="$( cd "$( dirname $(readlink -nf $0) )" && pwd )"
@ -6,7 +7,10 @@ grab_mod()
{
if [ -f "$SCRPATH/$1"/LICENSE ]; then
cd "$SCRPATH/$1"
git pull
if [ "$BUILD_UPDATE" -eq 1 ]; then
git pull
fi
else
cd "$SCRPATH"
git clone "$2" "$1"
@ -23,3 +27,4 @@ grab_mod scihunt https://www.github.com/eukara/freesci
grab_mod hunger https://www.github.com/eukara/freehunger
grab_mod valve https://www.github.com/eukara/freehl
grab_mod cstrike https://www.github.com/eukara/freecs
grab_mod ts https://www.github.com/Frag-Net/FreeTS