Skip to content

Commit

Permalink
[units.wesnoth.org] fix eras with all eras in an addon
Browse files Browse the repository at this point in the history
  • Loading branch information
allefant committed Jun 26, 2017
1 parent cb13449 commit c17d556
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions data/tools/unit_tree/update-wmlunits
Expand Up @@ -9,16 +9,18 @@ set -e -u
# must run from the correct directory
DIR="$(dirname $0)"

EXTRA_ADDON_OPTIONS=${EXTRA_ADDON_OPTIONS:-}
EXTRA_WMLUNITS_OPTIONS=${EXTRA_WMLUNITS_OPTIONS:-}
TIMEOUT=${TIMEOUT:-20}
SOURCES=/usr/src/wesnoth
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
OUT="elias@192.168.1.2:/srv/www/html/units/$VERSION"
OUT=${OUT:-"elias@192.168.1.2:/srv/www/html/units/$VERSION"}
TRANS=$DIR/translations
BUILD=$DIR/build
# always using the master version
Expand Down Expand Up @@ -47,9 +49,11 @@ TRAVIS=1 TRAVIS_OS_NAME=Linux scons -Y "$SRC" --option-cache="$BUILD/.scons-opti
rm -f $DIR/overview.txt

echo DOWNLOADING
$TOOLS/wesnoth_addon_manager -p $PORT -d '.*' -c $ADDONS > $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 > $LOG/wmlunits.txt 2>&1
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
Expand Down
4 changes: 2 additions & 2 deletions data/tools/wmlunits
Expand Up @@ -185,7 +185,7 @@ def list_contents():
dependency_eras = list(mainline_eras)
for d in get_all_dependencies(addon):
dinfo = search(batchlist, d)
for era in dinfo["eras"]:
for era in dinfo.get("eras", []):
dependency_eras.append(era["id"])
return dependency_eras

Expand Down Expand Up @@ -346,7 +346,7 @@ def list_contents():
except Exception as e:
ef = open(logname, "w")
ef.write("<INTERNAL ERROR>\n")
ef.write(str(e))
ef.write(repr(e))
ef.write("</INTERNAL ERROR>\n")
ef.close()
sys.stdout.write("failed\n")
Expand Down

0 comments on commit c17d556

Please sign in to comment.