[MacPorts] #17950: dbus patched with launchd support and version dump

MacPorts noreply at macports.org
Sat Jan 17 05:40:33 PST 2009


#17950: dbus patched with launchd support and version dump
---------------------------------+------------------------------------------
  Reporter:  jonas.baehr@…       |       Owner:  macports-tickets@…                   
      Type:  enhancement         |      Status:  reopened                             
  Priority:  Normal              |   Milestone:  Port Enhancements                    
 Component:  ports               |     Version:  1.7.0                                
Resolution:                      |    Keywords:  launchd kde4 x11                     
      Port:  dbus                |  
---------------------------------+------------------------------------------

Comment(by jonas.baehr@…):

 I've got a solution, not a perfect one though. The dbus-daemon get's only
 a file descriptor from launchd, not an unix path. The path can only be
 retrieved by querying launchd's envorinment. Here, the env-var is not the
 same as the key as for lookup the fd. Here is a hot fix which should be
 fine for 99.9% of the users.
 {{{
 diff --git a/dbus/dbus-server-launchd.c b/dbus/dbus-server-launchd.c
 index 1ede3cc..6bb8575 100644
 --- a/dbus/dbus-server-launchd.c
 +++ b/dbus/dbus-server-launchd.c
 @@ -71,12 +71,12 @@ _dbus_server_new_for_launchd_key (const char
 *socket_key,
        dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
        return NULL;
      }
 -  if (!_dbus_string_append (&address, "launchd:key="))
 +  if (!_dbus_string_append (&address, "unix:path="))
      {
        dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
        goto l_failed_0;
      }
 -  if (!_dbus_string_append (&address, socket_key))
 +  if (!_dbus_string_append (&address,
 _dbus_getenv("DBUS_LAUNCHD_SESSION_BUS_SOCKET")))
      {
        dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
        goto l_failed_0;
 }}}
 It has several problems though:
  * It allways assume the session bus. (no mapping from socket_key to env-
 var)
  * It works only if dbus-daemon is started by launchd. (else the env-var
 is simply not present)
 To make it short everything non-standard will not work: Custom busses and
 manual started dbus-daemons can't autolaunch services when using launchd-
 addresses. This are corner cases so in my eyes this patch can be used for
 our Portfile (for now) but for
 [http://bugs.freedesktop.org/show_bug.cgi?id=14259 dbus upstream] I have
 to think about something better...

-- 
Ticket URL: <http://trac.macports.org/ticket/17950#comment:42>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list