Author: soliton
Date: Sat Apr 26 20:10:52 2008
New Revision: 26139

URL: http://svn.gna.org/viewcvs/wesnoth?rev=26139&view=rev
Log:
* send error messages to STDERR
* get the server port from the redirect.cfg (which needs to be changed anyway)

Modified:
    trunk/utils/mp-server/new_release
    trunk/utils/mp-server/revert_build
    trunk/utils/mp-server/run_server
    trunk/utils/mp-server/send_server_command
    trunk/utils/mp-server/send_server_message
    trunk/utils/mp-server/update_server

Modified: trunk/utils/mp-server/new_release
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/mp-server/new_release?rev=26139&r1=26138&r2=26139&view=diff
==============================================================================
--- trunk/utils/mp-server/new_release (original)
+++ trunk/utils/mp-server/new_release Sat Apr 26 20:10:52 2008
@@ -6,7 +6,7 @@
        echo=""
 fi
 if ! [ $# -ge 1 ]; then
-        echo "Syntax: $0 [-n] <new minor version>"
+        echo "Syntax: $0 [-n] <new minor version>" >&2
         exit 1
 fi
 [ $1 -ge 1 ] || exit 1
@@ -31,14 +31,14 @@
 $echo killall -SIGHUP wesnothd-$DEV_VERSION-prev || exit 1
 # check if we currently allow the previous version to prevent announcing the 
same version twice
 if ! [ $(grep "versions_accepted=.*$PREV_VERSION" $DEV_SERVER_CONFIG) ]; then
-       echo "Previous version $PREV_VERSION currently not allowed. Announcing 
the right version? Aborting..."
+       echo "Previous version $PREV_VERSION currently not allowed. Announcing 
the right version? Aborting..." >&2
        exit 1
 fi
 $echo sed -i -e "/versions_accepted=/s/$PREV_VERSION/$NEXT_VERSION/" 
$DEV_SERVER_CONFIG
 $echo sed -i -e "/motd=/s/$PREV_VERSION/$NEW_VERSION/g" $DEV_SERVER_CONFIG
 # update previous version redirect
 $echo sed -i -e "/\[redirect\]/N;/version=/s/$PPREV_VERSION/$PREV_VERSION/" 
$PREV_SERVER_REDIRECT
-$echo sed -i -e 
"s,#{./$DEV_VERSION-prev-redirect.cfg},{./$DEV_VERSION-prev-redirect.cfg}," 
$DEV_SERVER_CONFIG
+$echo sed -i -e "s,#\({./$DEV_VERSION-prev-redirect.cfg}\),\1," 
$DEV_SERVER_CONFIG
 # reload the config
 $echo killall -SIGHUP wesnothd-$DEV_VERSION wesnothd-trunk || exit 1
-$echo send_server_command $DEV_VERSION msg Version $NEW_VERSION has been 
released! New users with the previous version will now get redirected to a 
temporary server that will run until binaries for all major OSs are out.
+$echo $HOME/bin/send_server_command $DEV_VERSION msg Version $NEW_VERSION has 
been released! New users with the previous version will now get redirected to a 
temporary server that will run until binaries for all major OSes are out.

Modified: trunk/utils/mp-server/revert_build
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/mp-server/revert_build?rev=26139&r1=26138&r2=26139&view=diff
==============================================================================
--- trunk/utils/mp-server/revert_build (original)
+++ trunk/utils/mp-server/revert_build Sat Apr 26 20:10:52 2008
@@ -1,6 +1,6 @@
 #!/bin/sh
 if ! [ $# -eq 1 ]; then
-       echo "Syntax: $0 <server version>"
+       echo "Syntax: $0 <server version>" >&2
        exit 1
 fi
 
@@ -8,7 +8,7 @@
 SERVERBASE=$HOME/servers/$SERVER
 
 if ! [ -d $SERVERBASE ]; then
-       echo "$SERVER server not found."
+       echo "$SERVER server not found." >&2
        exit 1
 fi
 

Modified: trunk/utils/mp-server/run_server
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/mp-server/run_server?rev=26139&r1=26138&r2=26139&view=diff
==============================================================================
--- trunk/utils/mp-server/run_server (original)
+++ trunk/utils/mp-server/run_server Sat Apr 26 20:10:52 2008
@@ -1,6 +1,6 @@
 #!/bin/sh
 if [ $# -lt 1 ]; then
-       echo "Syntax: $0 <server version> [<additional parameters for 
wesnothd>]"
+       echo "Syntax: $0 <server version> [<additional parameters for 
wesnothd>]" >&2
        exit 1
 fi
 
@@ -11,7 +11,7 @@
 SOURCE=$HOME/source/trunk
 
 if ! [ -d "$SERVERBASE" ]; then
-       echo "Server '$SERVER' not found."
+       echo "Server '$SERVER' not found." >&2
        exit 1
 fi
 [ -d "$SERVERBASE/logs" ] || mkdir $SERVERBASE/logs
@@ -30,7 +30,6 @@
                ;;
        * )
 esac
-OPTIONS="-c $SERVERBASE/wesnothd.cfg --port $PORT --threads $THREADS 
$PARAMETERS"
 
 ulimit -Ss 2048
 ulimit -c unlimited
@@ -43,18 +42,20 @@
        if ps -C wesnothd-$SERVER >/dev/null; then
                sleep 10
        else
-               DATE=$(date +"%Y%m%d-%H%M%S")
-               BUILDDIR=$(ls -l $SERVERBASE/build | sed -e 
's,.*\(\.\./builds/wesnothd-.*/\),\1,')
-               REV=$(ls -l $SERVERBASE/build | sed -e 
's,.*wesnothd-\(svn-.*\)_.*/,\1,')
-               LOG=wesnothd.$DATE.$REV.log
                cd $SERVERBASE/build || exit 1
                if ! [ -x bin/wesnothd-$SERVER ]; then
-                       echo "Executable 'bin/wesnothd-$SERVER' not found."
+                       echo "Executable 'bin/wesnothd-$SERVER' not found." >&2
                        exit 1
                fi
-               nice -n 3 bin/wesnothd-$SERVER $OPTIONS > $SERVERBASE/logs/$LOG 
2>&1 &
+               DATE=$(date +"%Y%m%d-%H%M%S")
+               PORT=$(sed -re '/port=/!d;s/[ \t]*port="?([0-9]+)"?/\1/' 
$SERVERBASE/redirect.cfg)
+               BUILDDIR=$(ls -l $SERVERBASE/build | cut -d ' ' -f 12)
+               REV=r$(echo "$BUILDDIR" | sed -re 
"s,.*wesnothd-svn-([0-9:SM]+)_$SERVER/$,\1,")
+               LOG=wesnothd.$DATE.$REV.log
+               COMMAND="bin/wesnothd-$SERVER -c $SERVERBASE/wesnothd.cfg 
--port $PORT --threads $THREADS $PARAMETERS"
+               nice -n 3 $COMMAND > $SERVERBASE/logs/$LOG 2>&1 &
                PID=$!
-               echo -n "started $SERVER server (revision: $REV, pid: $PID) at: 
"; date
+               echo "started $SERVER server with command: '$COMMAND' 
(revision: $REV, pid: $PID) at: $DATE"
                ln -s ../../$SERVER/logs/$LOG $LOG.$PID
                rm -f $SERVERBASE/old.log
                mv $SERVERBASE/current.log $SERVERBASE/old.log > /dev/null 2>&1

Modified: trunk/utils/mp-server/send_server_command
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/mp-server/send_server_command?rev=26139&r1=26138&r2=26139&view=diff
==============================================================================
--- trunk/utils/mp-server/send_server_command (original)
+++ trunk/utils/mp-server/send_server_command Sat Apr 26 20:10:52 2008
@@ -1,6 +1,6 @@
 #!/bin/sh
 if ! [ $# -ge 2 ]; then
-       echo "Syntax: $0 <server version> <command [arguments]>"
+       echo "Syntax: $0 <server version> <command [arguments]>" >&2
        exit 1
 fi
 
@@ -8,15 +8,16 @@
 SERVERBASE=$HOME/servers/$SERVER
 SOCKET=$SERVERBASE/build/var/run/socket
 if ! [ -d "$SERVERBASE" ]; then
-       echo "Server '$SERVER' not found."
+       echo "Server '$SERVER' not found." >&2
        exit 1
 fi
 if ! [ -e $SOCKET ]; then
-       echo "$SOCKET not found, using the 'oldbuild'."
+       echo "$SOCKET not found, using the 'oldbuild'." >&2
        SOCKET=$SERVERBASE/oldbuild/var/run/socket
 fi
 if ! [ -p $SOCKET ]; then
-       echo "$SOCKET is not a named pipe (fifo)"
+       echo "$SOCKET is not a named pipe (fifo)." >&2
+       echo "Is the $SERVER server running?" >&2
        exit 1
 fi
 

Modified: trunk/utils/mp-server/send_server_message
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/mp-server/send_server_message?rev=26139&r1=26138&r2=26139&view=diff
==============================================================================
--- trunk/utils/mp-server/send_server_message (original)
+++ trunk/utils/mp-server/send_server_message Sat Apr 26 20:10:52 2008
@@ -1,6 +1,6 @@
 #!/bin/sh
 if ! [ $# -ge 1 ]; then
-       echo "Syntax: $0 <server version> [message]"
+       echo "Syntax: $0 <server version> [message]" >&2
        exit 1
 fi
 
@@ -8,7 +8,7 @@
 SERVERBASE=$HOME/servers/$SERVER
 SOCKET=$SERVERBASE/build/var/run/socket
 if ! [ -d "$SERVERBASE" ]; then
-       echo "Server '$SERVER' not found."
+       echo "Server '$SERVER' not found." >&2
        exit 1
 fi
 shift
@@ -20,11 +20,12 @@
 fi
 
 if ! [ -e $SOCKET ]; then
-       echo "$SOCKET not found, sending to the 'oldbuild'."
+       echo "$SOCKET not found, sending to the 'oldbuild'." >&2
        SOCKET=$SERVERBASE/oldbuild/var/run/socket
 fi
 if ! [ -p $SOCKET ]; then
-       echo "$SOCKET is not a named pipe (fifo)"
+       echo "$SOCKET is not a named pipe (fifo)." >&2
+       echo "Is the $SERVER server running?" >&2
        exit 1
 fi
 

Modified: trunk/utils/mp-server/update_server
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/mp-server/update_server?rev=26139&r1=26138&r2=26139&view=diff
==============================================================================
--- trunk/utils/mp-server/update_server (original)
+++ trunk/utils/mp-server/update_server Sat Apr 26 20:10:52 2008
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ $# -gt 2 -o $# -lt 1 ]; then
-       echo "Syntax: $0 <server version> [<revision>]"
+       echo "Syntax: $0 <server version> [<revision>]" >&2
        exit 1
 fi
 
@@ -11,12 +11,12 @@
 SOCKET=$SERVERBASE/build/var/run/socket
 
 if ! [ -d $SERVERBASE ]; then
-       echo "$SERVER server not found."
+       echo "$SERVER server not found." >&2
        exit 1
 fi
 
 if ! [ -d $SOURCE ]; then
-       echo "$SOURCE not found."
+       echo "$SOURCE not found." >&2
        exit 1
 fi
 # only really needed on server.wesnoth.org
@@ -28,7 +28,7 @@
        ;;
        1.4 )   cd $SOURCE/1.4   || exit 1
                CXXFLAGS="$CXXFLAGS -ggdb3 -DNUM_SHARDS=7"
-               #SCONS=yes
+               SCONS=yes
        ;;
        *   )   cd $SOURCE/trunk || exit 1
                CXXFLAGS="$CXXFLAGS -ggdb3 -DNUM_SHARDS=7 -O0"
@@ -42,10 +42,10 @@
 fi
 echo -n 'svn update... '
 svn up $REVISION > /dev/null
-rev=$(svnversion -n src/)
+rev=$(svnversion -cn src/ | cut -d: -f2)
 echo "to $rev"
 if [ "$rev" = "" ]; then
-       echo "No revision information found."
+       echo "No revision information found." >&2
        exit 1
 fi
 # reminder for local changes


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to