Message: previous - next
Month: April 2012

Slavek: Request help revising starttde

From: Darrell Anderson <humanreadable@...>
Date: Sun, 8 Apr 2012 11:43:24 -0700 (PDT)

As I mentioned in previous posts, the current mechanism in starttde causes $TDEDIRS to be ignored when $XDG_DATA_DIRS is explicitly defined in the environment.

I know what we need to do, but my regex skills are much to be desired. You helped with the last revision and probably can help again. :)

This is what we need to add to the existing snippet regarding $XDG_DATA_DIRS:

* When $TDEDIRS is not defined in the environment, do nothing additional. Leave functionality as is.

* When $TDEDIRS is defined then parse that variable into separate directories. Use those separate directories to form the $XDG_DATA_DIRS variable.


Explicitly declaring $XDG_DATA_DIRS will override $TDEDIRS, which must then be explicitly identified in the $XDG_DATA_DIRS string to remain useful. When $XDG_DATA_DIRS is not explicitly declared, then $TDEDIRS is recognized and works as intended. Therefore we need to compensate when explicitly declaring $XDG_DATA_DIRS.

The $TDEDIR variable is intended to be singular and $TDEDIRS plural. When $TDEDIRS exists in the environment then parse that variable into separate directories.

By design, $TDEDIRS should contain whatever is set in $TDEDIR. Therefore any additional directories set in $TDEDIRS are intended to override data files found in $TDEDIR. In both $TDEDIRS and $XDG_DATA_DIRS, those additional directories should be placed before $TDEDIR and before /usr/share.

In $XDG_DATA_DIRS, $TDEDIR should be placed before /usr/share to ensure those data files override anything in /usr/share.

For example, on my system I have the following:


Therefore in my system, $XDG_DATA_DIRS should look like this:


I know of no limitations for expanding $TDEDIRS. Theoretically then, $TDEDIRS could contain more than two directories, but the last directory in the $TDEDIRS variable should always be what is defined in $TDEDIR.

For example, the following presumably could exist:


Therefore $XDG_DATA_DIRS would look like this:


I appreciate any help. Of course, I will test as much as possible.

Thank you!