~ubuntu-branches/ubuntu/precise/folks/precise

« back to all changes in this revision

Viewing changes to tests/tools/with-session-bus-tracker.sh

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2011-06-10 11:28:11 UTC
  • mfrom: (1.2.11 upstream) (4.2.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110610112811-whyeodbo9mjezxfp
Tags: 0.5.2-1ubuntu1
* Merge with Debian experimental, remaining Ubuntu changes:
  - debian/control:
    + Add Vcs-Bzr link

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# with-session-bus.sh - run a program with a temporary D-Bus session daemon
 
3
#
 
4
# interesting bits have been move into dbus to permit reusability
 
5
#
 
6
# Copyright (C) 2007-2008 Collabora Ltd. <http://www.collabora.co.uk/>
 
7
#
 
8
# Copying and distribution of this file, with or without modification,
 
9
# are permitted in any medium without royalty provided the copyright
 
10
# notice and this notice are preserved.
 
11
 
 
12
 
 
13
cur_dir=`dirname $0`
 
14
 
 
15
. $cur_dir"/dbus-session.sh"
 
16
. $cur_dir"/tracker.sh"
 
17
 
 
18
dbus_parse_args $@
 
19
while test "z$1" != "z--"; do
 
20
    shift
 
21
done
 
22
shift
 
23
if test "z$1" = "z"; then dbus_usage; fi
 
24
 
 
25
cleanup ()
 
26
{
 
27
    tracker_stop
 
28
    dbus_stop
 
29
}
 
30
 
 
31
trap cleanup INT HUP TERM
 
32
 
 
33
tracker_init_settings
 
34
dbus_init 0
 
35
 
 
36
dbus_start
 
37
tracker_start
 
38
 
 
39
e=0
 
40
"$@" || e=$?
 
41
 
 
42
trap - INT HUP TERM
 
43
cleanup
 
44
 
 
45
exit $e