From ba3199d5394b29e508cb299fb7d5d2d3d94bfe0f Mon Sep 17 00:00:00 2001 From: Gunter Labes Date: Fri, 30 Nov 2007 14:00:42 +0000 Subject: [PATCH] add a script to update the unit tree on new releases; putting it here since it's configured to be run on server.wesnoth.org --- utils/mp-server/update_unit_tree | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 utils/mp-server/update_unit_tree diff --git a/utils/mp-server/update_unit_tree b/utils/mp-server/update_unit_tree new file mode 100755 index 00000000000..384c659c240 --- /dev/null +++ b/utils/mp-server/update_unit_tree @@ -0,0 +1,48 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "Syntax: $0 " + exit 1 +fi + +VERSION=$1 +SITE=$HOME/public_html +SOURCE=$HOME/source +TRUNK=$SOURCE/trunk/ +STABLE=$SOURCE/1.2/ + +if ! [ -d $SOURCE ]; then + echo "$SOURCE not found." + exit 1 +fi + +case $VERSION in + 1.2 ) cd $STABLE || exit 1 + ;; + 1.3.* ) cd $TRUNK || exit 1 + ;; + trunk ) cd $TRUNK || exit 1 + rm -rf $SITE + ;; + * ) echo "Unknown version." + exit 1 + ;; +esac +if [ -d $SITE/$VERSION ]; then + echo "$SITE/$VERSION already exists." + exit 1 +fi +cd data/tools/unit_tree/ || exit 1 +echo 'svn update...' +svn update +svn status +# make sure we update with the right version +sed -i -e "s/\(my \$version = '\).*\(';\)/\1$VERSION\2/" units.pl +./units.pl +# move the generated files to their proper place +mv files $SITE/$VERSION +# insert a link for the new version +if [ "$VERSION" != "trunk" ]; then + sed -e "s,\(

Trunk

\),

Development ($VERSION)

\n\1," $SITE/index.html +fi +