[patch] standard_session_servicedirs (was Re: OLPC and .service files in a users home directory)

Thiago Macieira thiago at kde.org
Wed Nov 1 13:31:36 PST 2006


Some more comments:

John (J5) Palmieri wrote:
>+    case ELEMENT_STANDARD_SESSION_SERVICEDIRS:
>+      {
>+        DBusList *link;
>+        DBusList *dirs;
>+        dirs = NULL;
> 
>+        if (!_dbus_get_standard_session_servicedirs (&dirs))
>+          goto nomem;
>+
>+        while ((link = _dbus_list_pop_first_link (&dirs)))
>+          service_dirs_append_link_unique_or_free
> (&parser->service_dirs, link); 
> +      } 
>     case ELEMENT_SERVICEDIR:

Looks like a "break" is missing before the "case" above.

>+/**
>+ * Returns the standard directories for a session bus to look for
> service 
> + * activation files 
>+ *
>+ * On UNIX this should be the standard xdg freedesktop.org data
> directories: 
> + * 
>+ * XDG_DATA_HOME=${XDG_DATA_HOME-$HOME}/.local/share
>+ * XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/share:/usr/local/share}

You may as well fix the comment above too. It's:
	XDG_DATA_HOME=${XDG_DATA_HOME-$HOME/.local/share}
	XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/local/share:/usr/share}

That is, we don't append ".local/share" to $XDG_DATA_HOME. And /usr has 
higher priority than /usr/local. Like $PATH, those dirs are searched in 
order. Unlike $PATH, the latter overrides the former.

BTW, the specification is here:
http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html

>+  xdg_data_home = _dbus_getenv ("XDG_DATA_HOME");
>+  xdg_data_dirs = _dbus_getenv ("XDG_DATA_DIRS");
>+
>+  if (xdg_data_home != NULL)
>+    {
>+      if (!_dbus_string_append (&servicedir_path, xdg_data_home))
>+        goto oom;
>+
>+      if (!_dbus_string_append (&servicedir_path, ":"))
>+        goto oom;
>+    }
[snip]

>+  if (xdg_data_dirs != NULL)
>+    {
>+      if (!_dbus_string_append (&servicedir_path, xdg_data_dirs))
>+        goto oom;
>+    }
>+  else
>+    {
>+      if (!_dbus_string_append (&servicedir_path, "/usr/share:"))
>+        goto oom;
>+
>+      if (!_dbus_string_append (&servicedir_path, "/usr/local/share"))
>+        goto oom;
>+    }

The list is inverted. /usr/local/share should be the first (lowest 
priority), /usr/share next, $DATADIR next and $XDG_DATA_HOME last 
(highest priority).

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20061101/dbb63e96/attachment.pgp


More information about the dbus mailing list