[Telepathy-commits] [telepathy-sofiasip/master] Updated with-session-bus.sh from telepathy-gabble

Mikhail Zabaluev mikhail.zabaluev at nokia.com
Tue Jan 27 09:00:04 PST 2009


---
 tests/twisted/tools/with-session-bus.sh |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/tools/with-session-bus.sh b/tests/twisted/tools/with-session-bus.sh
index 26d9f24..9e3ecbe 100644
--- a/tests/twisted/tools/with-session-bus.sh
+++ b/tests/twisted/tools/with-session-bus.sh
@@ -4,7 +4,7 @@
 # The canonical location of this program is the telepathy-glib tools/
 # directory, please synchronize any changes with that copy.
 #
-# Copyright (C) 2007 Collabora Ltd. <http://www.collabora.co.uk/>
+# Copyright (C) 2007-2008 Collabora Ltd. <http://www.collabora.co.uk/>
 #
 # Copying and distribution of this file, with or without modification,
 # are permitted in any medium without royalty provided the copyright
@@ -15,16 +15,26 @@ set -e
 me=with-session-bus
 
 dbus_daemon_args="--print-address=5 --print-pid=6 --fork"
+sleep=0
 
 usage ()
 {
   echo "usage: $me [options] -- program [program_options]" >&2
   echo "Requires write access to the current directory." >&2
+  echo "" >&2
+  echo "If \$WITH_SESSION_BUS_FORK_DBUS_MONITOR is set, fork dbus-monitor" >&2
+  echo "with the arguments in \$WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT." >&2
+  echo "The output of dbus-monitor is saved in $me-<pid>.dbus-monitor-logs" >&2
   exit 2
 }
 
 while test "z$1" != "z--"; do
   case "$1" in
+  --sleep=*)
+    sleep="$1"
+    sleep="${sleep#--sleep=}"
+    shift
+    ;;
   --session)
     dbus_daemon_args="$dbus_daemon_args --session"
     shift
@@ -65,8 +75,19 @@ dbus-daemon $dbus_daemon_args
 e=0
 DBUS_SESSION_BUS_ADDRESS="`cat $me-$$.address`"
 export DBUS_SESSION_BUS_ADDRESS
+
+if [ -n "$WITH_SESSION_BUS_FORK_DBUS_MONITOR" ] ; then
+  echo -n "Forking dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT" >&2
+  dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT \
+        &> $me-$$.dbus-monitor-logs &
+fi
+
 "$@" || e=$?
 
+if test $sleep != 0; then
+  sleep $sleep
+fi
+
 trap - INT HUP TERM
 cleanup
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list