scripts.patch

liveriondev, 05/06/2010 10:43 pm

Download (5.1 kB)

b/code/ryzom/tools/scripts/linux/build Thu May 06 22:45:16 2010 +0200
49 49

50 50
# Set the source directory. Use the environment SRC_DIR variable, if it's
51 51
# not set, use $HOME/cvs as a default value
52
SRC_DIR="$HOME/code"
52
SRC_DIR="$RYZOM_PATH/../../code"
53 53

54 54
# Build diretories
55 55
BUILD_DEBUG="$SRC_DIR/build/debug"
......
74 74
###########################################################################
75 75

76 76
# Flag files associated to each mode
77
DEBUG_FILE="$HOME/.mode_debug"
78
STATIC_FILE="$HOME/.mode_static"
79
DYNAMIC_FILE="$HOME/.mode_dynamic"
80
SILENT_FILE="$HOME/.mode_silent"
77
DEBUG_FILE="$RYZOM_PATH/.mode_debug"
78
STATIC_FILE="$RYZOM_PATH/.mode_static"
79
DYNAMIC_FILE="$RYZOM_PATH/.mode_dynamic"
80
SILENT_FILE="$RYZOM_PATH/.mode_silent"
81 81

82 82
# Specify the source code directory of each projects
83 83
NEL_SRC="$SRC_DIR/nel"
b/code/ryzom/tools/scripts/linux/buildmode Thu May 06 22:45:16 2010 +0200
4 4
###########################################################################
5 5

6 6
# Files associated to each mode
7
DEBUG_FILE=$HOME/.mode_debug
8
#RELEASE_FILE=$HOME/.mode_release
9
STATIC_FILE=$HOME/.mode_static
10
DYNAMIC_FILE=$HOME/.mode_dynamic
11
SILENT_FILE=$HOME/.mode_silent
7
DEBUG_FILE=$RYZOM_PATH/.mode_debug
8
#RELEASE_FILE=$RYZOM_PATH/.mode_release
9
STATIC_FILE=$RYZOM_PATH/.mode_static
10
DYNAMIC_FILE=$RYZOM_PATH/.mode_dynamic
11
SILENT_FILE=$RYZOM_PATH/.mode_silent
12 12

13 13

14 14
###########################################################################
b/code/ryzom/tools/scripts/linux/make_all Thu May 06 22:45:16 2010 +0200
1 1
#!/bin/sh -
2 2

3
RYZOM_PATH="$HOME/code/ryzom"
3
export RYZOM_PATH="$HOME/code/ryzom"
4 4

5 5
. $RYZOM_PATH/tools/scripts/linux/utilities
6 6

b/code/ryzom/tools/scripts/linux/utilities Thu May 06 22:45:16 2010 +0200
3 3
SSH_AGENT_FILE="$HOME/ssh_agent_file"
4 4

5 5
BASENAME=`basename $0`
6
LOG_INFO="$HOME/log/${BASENAME}_info.log"
7
LOG_ERROR="$HOME/log/${BASENAME}_error.log"
6
LOG_INFO="$RYZOM_PATH/log/${BASENAME}_info.log"
7
LOG_ERROR="$RYZOM_PATH/log/${BASENAME}_error.log"
8 8

9 9
# first param is the subject line
10 10
# others params are email
11
function send_mail()
11
send_mail()
12 12
{
13 13
	SUBJECT=$1
14 14
	shift
......
16 16
	cat $LOG_ERROR | mail -s "$SUBJECT on `hostname`" $*
17 17
}
18 18

19
function print_success()
19
print_success()
20 20
{
21 21
	echo "*********************** $* SUCCESS !"
22 22
	echo
23 23
}
24 24

25
function print_failure()
25
print_failure()
26 26
{
27 27
	echo "***************************************************"
28 28
	echo "***************************************************"
......
34 34

35 35
# failed fill the log and send email if necessary
36 36
# argument are the error message
37
function failed()
37
failed()
38 38
{
39 39
	print_failure $*
40 40
	if [ "X$LOG_INFO" != "X" ]
......
59 59

60 60
# useful function to avoid continuing if something goes wrong
61 61
# first param is $? and second is the string that will display
62
function verify()
62
verify()
63 63
{
64 64
	if [ $1 -eq 0 ]
65 65
		then
......
80 80
}
81 81

82 82
# step_failed() fills the log and increments $STEPS_FAILURES
83
function step_failed()
83
step_failed()
84 84
{
85 85
	print_failure $*
86 86
	if [ "X$LOG_INFO" != "X" ]
......
102 102

103 103
# call init_steps() before you use step()
104 104
# it takes a label for following steps as parameter
105
function init_steps()
105
init_steps()
106 106
{
107 107
	STEPS_LABEL="$*"
108 108
	STEPS_FAILURES=0
......
110 110

111 111
# like verify() but will continue even if step failed until verify_steps() is called
112 112
# first param is $? and second is the string that will display
113
function step()
113
step()
114 114
{
115 115
	if [ $1 -eq 0 ]
116 116
		then
......
131 131
}
132 132

133 133
# call verify_steps() when you want to stop if error(s) occured in previous steps
134
function verify_steps()
134
verify_steps()
135 135
{
136 136
    if [ $STEPS_FAILURES -eq 0 ]
137 137
        then
......
154 154
    fi
155 155
}
156 156

157
function ask_confirmation()
157
ask_confirmation()
158 158
{
159 159
	echo "Using this script will destroy the current version, type 'yes' if you really want to do that"
160 160
	read CONF
......
163 163
	fi
164 164
}
165 165

166
function check_host()
166
check_host()
167 167
{
168 168
	HOST=`hostname -s`
169 169
	if [ "X$HOST" != "X$1" ]; then
......
172 172
}
173 173

174 174
# useful function to initialize the default log for all scripts
175
function init()
175
init()
176 176
{
177 177
	if [ "X$LOG_INFO" != "X" ]
178 178
		then
179
		test -d `dirname $LOG_INFO` || mkdir -p `dirname $LOG_INFO`
179 180
		test ! -f $LOG_INFO || rm $LOG_INFO
180 181
		touch $LOG_INFO
181 182
		# display all ulimit in the log
......
184 185

185 186
	if [ "X$LOG_ERROR" != "X" ]
186 187
		then
188
		test -d `dirname $LOG_ERROR` || mkdir -p `dirname $LOG_ERROR`
187 189
		test ! -f $LOG_ERROR || rm $LOG_ERROR
188 190
		touch $LOG_ERROR
189 191
	fi
190 192
}
191 193

192
function init_ssh()
194
init_ssh()
193 195
{
194 196
	if [ ! -f $SSH_AGENT_FILE ]
195 197
		then