Skip to content

Commit

Permalink
only keep env vars upper case, add missing quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
soliton- committed Jan 9, 2018
1 parent a535a31 commit 7cdec04
Showing 1 changed file with 32 additions and 34 deletions.
66 changes: 32 additions & 34 deletions data/tools/unit_tree/update-wmlunits
Expand Up @@ -7,56 +7,54 @@ set -e -u
# PORT=1.12.x

# must run from the correct directory
DIR="$(dirname $0)"
dir="$(dirname "$0")"

EXTRA_ADDON_OPTIONS=${EXTRA_ADDON_OPTIONS:-}
EXTRA_WMLUNITS_OPTIONS=${EXTRA_WMLUNITS_OPTIONS:-}
TIMEOUT=${TIMEOUT:-20}
SOURCES=${SOURCES:-/usr/src/wesnoth}
ADDONS=$DIR/addons
EXE=$DIR/wesnoth
CONFIG=$DIR/config
SRC=$SOURCES/$VERSION
DATA=$SRC
LOG=$DIR/logs
TMPOUT=$DIR/output
addons=$dir/addons
exe=$dir/wesnoth
config=$dir/config
src=$SOURCES/$VERSION
data=$src
log=$dir/logs
tmpout=$dir/output
OUT=${OUT:-"/srv/www/html/units/$VERSION"}
TRANS=$DIR/translations
BUILD=$DIR/build
trans=$dir/translations
build=$dir/build
# always using the master version
TOOLS=${TOOLS:-$SOURCES/master/data/tools}
export TEMP=$DIR/temp
export TEMP=$dir/temp

# in case there's leftovers from a previous run
rm -rf $CONFIG/data/add-ons
rm -rf $TMPOUT
rm -rf "$config/data/add-ons"
rm -rf "$tmpout"
rm -rf "$TEMP"

mkdir -p $CONFIG/data/add-ons
mkdir -p $ADDONS
mkdir -p $LOG
mkdir -p $TMPOUT
mkdir -p $TEMP
mkdir -p translations

rm -rf $TEMP/*
mkdir -p "$config/data/add-ons"
mkdir -p "$addons"
mkdir -p "$log"
mkdir -p "$tmpout"
mkdir -p "$TEMP"
mkdir -p "$trans"

# we only need the parser, but have to build the game executable for that
echo BUILDING
cd $DIR # the scons build places the wesnoth executable in the current directory
TRAVIS=1 TRAVIS_OS_NAME=Linux scons -Y "$SRC" --option-cache="$BUILD/.scons-option-cache"
cd "$dir" || exit # the scons build places the wesnoth executable in the current directory
TRAVIS=1 TRAVIS_OS_NAME=Linux scons -Y "$src" --option-cache="$build/.scons-option-cache"

# later can just rebuild updated campaigns, but for now rebuild everything
rm -f $DIR/overview.txt
rm -f "$dir/overview.txt"

echo DOWNLOADING
$TOOLS/wesnoth_addon_manager -p $PORT -d '.*' -c $ADDONS $EXTRA_ADDON_OPTIONS > $LOG/wesnoth_addon_manager.txt 2>&1
"$TOOLS/wesnoth_addon_manager" -p "$PORT" -d '.*' -c "$addons" $EXTRA_ADDON_OPTIONS > "$log/wesnoth_addon_manager.txt" 2>&1
echo WORKING
python3 -u $TOOLS/wmlunits -t $TRANS -D $DATA -o $TMPOUT -w $EXE \
-C $CONFIG -a $ADDONS -L $DIR/overview.txt -B $DIR/overview.txt \
-T $TIMEOUT $EXTRA_WMLUNITS_OPTIONS > $LOG/wmlunits.txt 2>&1
test -f $TMPOUT/mainline/en_US/mainline.html
test -f $TMPOUT/'pics/core$images$units$woses$wose.png'
rsync -vaz --delete $TMPOUT/ $OUT > $LOG/rsync.txt 2>&1
rm -rf $TEMP/*
rm -rf $TMPOUT

python3 -u "$TOOLS/wmlunits" -t "$trans" -D "$data" -o "$tmpout" -w "$exe" \
-C "$config" -a "$addons" -L "$dir/overview.txt" -B "$dir/overview.txt" \
-T "$TIMEOUT" $EXTRA_WMLUNITS_OPTIONS > "$log/wmlunits.txt" 2>&1
test -f "$tmpout"/mainline/en_US/mainline.html
test -f "$tmpout"/'pics/core$images$units$woses$wose.png'
rsync -vaz --delete "$tmpout/" "$OUT" > "$log/rsync.txt" 2>&1
rm -rf "$TEMP"
rm -rf "$tmpout"

0 comments on commit 7cdec04

Please sign in to comment.