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
This commit is contained in:
parent
f77168b556
commit
ba3199d539
1 changed files with 48 additions and 0 deletions
48
utils/mp-server/update_unit_tree
Executable file
48
utils/mp-server/update_unit_tree
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Syntax: $0 <wesnoth version>"
|
||||
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,\(<p><a href=\"trunk/index.html\">Trunk</a></p>\),<p><a href=\"$VERSION/index.html\">Development ($VERSION)</a></p>\n\1," $SITE/index.html
|
||||
fi
|
||||
|
Loading…
Add table
Reference in a new issue