Slavek,
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.
Notes:
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:
$TDEDIR=/opt/trinity
$TDEDIRS=/usr/local/tde-mods:/opt/trinity
Therefore in my system, $XDG_DATA_DIRS should look like this:
XDG_DATA_DIRS=/usr/local/tde-mods/share:/opt/trinity/share:/usr/share
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:
$TDEDIR=/opt/trinity
$TDEDIRS=/usr/local/tde-mods:/opt/tde-mods:/opt/trinity
Therefore $XDG_DATA_DIRS would look like this:
XDG_DATA_DIRS=/usr/local/tde-mods/share:/opt/tde-mods/share:/opt/trinity/share:/usr/share
I appreciate any help. Of course, I will test as much as possible.
Thank you!
Darrell