Debian Codegraph @

spec/tools/dbus-launch-simple

raw symbols SCIP
1 #! /bin/shscip-shell filesystem . . `/bin/sh`.
2 # A wrapper for DBus tests
3 # Reimplementing dbus-launch because it is in dbus-1-x11.rpm
4 # Sets up a private session bus and call the specified program
5 set -o errexit
6
7 # This launches the bus daemon,
8 # exports DBUS_SESSION_BUS_ADDRESS and sets DBUS_SESSION_BUS_PID
9 my_dbus_launchscip-shell shell shell-project 0.0.0 my_dbus_launch(). () {
10 # reimplementing dbus-launch because it is in dbus-1-x11.rpm
11 PF=`mktempscip-shell system . . mktemp. dbus.pid.XXXXXX` || exit
12 AF=`mktempscip-shell system . . mktemp. dbus.addr.XXXXXX` || exit
13 RM_FILES="$RM_FILES $PF $AF"
14
15 # For debugging:
16 # DBUS_DAEMON=~/svn/dbus/bus/dbus-daemon DBUS_VERBOSE=1 ./spec/tools/test_env env PS1="TEST $PS1" bash
17 : ${DBUS_DAEMON=dbus-daemon}
18 $DBUS_DAEMON --config-file=$(dirnamescip-shell system . . dirname. $0)/dbus-limited-session.conf --print-address=3 3>$AF --print-pid=4 4>$PF &
19 # wait for the daemon to print the info
20 TRIES=0
21 while [scip-shell system . . `[`. ! -s $AF -o ! -s $PF ]; do
22 sleepscip-shell system . . sleep. 0.1
23 TRIES=`exprscip-shell system . . expr. $TRIES + 1`
24 if [scip-shell system . . `[`. $TRIES -gt 100 ]; then echoscip-shell system . . echo. "dbus-daemon failed?"; exit 1; fi
25 done
26 DBUS_SESSION_BUS_PID=$(catscip-shell system . . cat. $PF)
27 export DBUS_SESSION_BUS_ADDRESS=$(catscip-shell system . . cat. $AF)
28 KILLS="$KILLS $DBUS_SESSION_BUS_PID"
29 # dbus-monitor &
30 }
31
32 # Clean up at exit.
33 trap "kill \$KILLS; rm -rf \$RM_FILES" EXIT TERM INT
34
35 my_dbus_launchscip-shell shell shell-project 0.0.0 my_dbus_launch().
36
37 # run the payload; the return value is passed on
38 "$@"