dbus/tools dbus-launch.c, 1.20, 1.21 run-with-tmp-session-bus.sh, 1.4, 1.5

John Palmieri johnp at kemper.freedesktop.org
Thu Oct 26 08:55:46 PDT 2006


Update of /cvs/dbus/dbus/tools
In directory kemper:/tmp/cvs-serv23029/tools

Modified Files:
	dbus-launch.c run-with-tmp-session-bus.sh 
Log Message:
* tools/dbus-launch.c (main): run the dbus-daemon in the builddir
  if tests are enabled and the DBUS_USE_TEST_BINARY env variable is set

* tools/run-with-tmp-session-bus.sh: set DBUS_USE_TEST_BINARY
  before we run dbus-launch

* configure.in: define TEST_BUS_BINARY to be the full path to 
  dbus-daemon in the build root 


Index: dbus-launch.c
===================================================================
RCS file: /cvs/dbus/dbus/tools/dbus-launch.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- dbus-launch.c	1 Oct 2006 22:21:30 -0000	1.20
+++ dbus-launch.c	26 Oct 2006 15:55:44 -0000	1.21
@@ -886,7 +886,26 @@
                "%d", bus_address_to_launcher_pipe[WRITE_END]);
 
       verbose ("Calling exec()\n");
-      
+ 
+#ifdef DBUS_BUILD_TESTS 
+      /* exec from testdir */
+      if (getenv("DBUS_USE_TEST_BINARY") != NULL)
+        {
+          execl (TEST_BUS_BINARY,
+                 TEST_BUS_BINARY,
+                 "--fork",
+                 "--print-pid", write_pid_fd_as_string,
+                 "--print-address", write_address_fd_as_string,
+                 config_file ? "--config-file" : "--session",
+                 config_file, /* has to be last in this varargs list */
+                 NULL); 
+
+          fprintf (stderr,
+                   "Failed to execute test message bus daemon %s: %s. Will try again with the system path.\n",
+                   TEST_BUS_BINARY, strerror (errno));
+        }
+ #endif /* DBUS_BUILD_TESTS */
+
       execl (DBUS_DAEMONDIR"/dbus-daemon",
              DBUS_DAEMONDIR"/dbus-daemon",
              "--fork",

Index: run-with-tmp-session-bus.sh
===================================================================
RCS file: /cvs/dbus/dbus/tools/run-with-tmp-session-bus.sh,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- run-with-tmp-session-bus.sh	1 Oct 2006 03:18:47 -0000	1.4
+++ run-with-tmp-session-bus.sh	26 Oct 2006 15:55:44 -0000	1.5
@@ -47,6 +47,7 @@
 
 echo "Running $DBUS_TOP_BUILDDIR/tools/dbus-launch --sh-syntax --config-file=$CONFIG_FILE" >&2
 
+export DBUS_USE_TEST_BINARY=1 
 eval `$DBUS_TOP_BUILDDIR/tools/dbus-launch --sh-syntax --config-file=$CONFIG_FILE`
 
 if test -z "$DBUS_SESSION_BUS_PID" ; then



More information about the dbus-commit mailing list