# HG changeset patch # User Goffi # Date 1307378080 -7200 # Node ID f147b778511a0b74f1fbc3fe6efa5448049af08d # Parent d98b7391d76c9eb694a28fe4a3f77e52cffd03e1 core: local_dir can now be overrided (usefull to launch 2 instances at the same time) diff -r d98b7391d76c -r f147b778511a src/core/sat_main.py --- a/src/core/sat_main.py Sat Jun 04 19:11:38 2011 +0200 +++ b/src/core/sat_main.py Mon Jun 06 18:34:40 2011 +0200 @@ -75,6 +75,13 @@ def get_const(self, name): """Return a constant""" + try: + _const = os.environ['SAT_CONST_%s' % name] + if _const: + debug(_("Constant %(name)s overrided with [%(value)s]") % {'name':name, 'value': _const}) + return _const + except KeyError: + pass if not CONST.has_key(name): error(_('Trying to access an undefined constant')) raise Exception diff -r d98b7391d76c -r f147b778511a src/sat.sh --- a/src/sat.sh Sat Jun 04 19:11:38 2011 +0200 +++ b/src/sat.sh Mon Jun 06 18:34:40 2011 +0200 @@ -16,8 +16,14 @@ NAME='sat' -PID_FILE="/tmp/$NAME.pid" -LOG_FILE=~/".$NAME/$NAME.log" +if [ -n "$SAT_CONST_local_dir" ];then + echo "Using overidded local dir: $SAT_CONST_local_dir" + PID_FILE="$SAT_CONST_local_dir/$NAME.pid" + LOG_FILE="$SAT_CONST_local_dir/$NAME.log" +else + PID_FILE="/tmp/$NAME.pid" + LOG_FILE=~/".$NAME/$NAME.log" +fi DAEMON="n" MAIN_OPTIONS="-${DAEMON}oy" TAP_PATH="./"