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
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.
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 posted a patch to starttde in bug report 675 (http://bugs.pearsoncomputing.net/show_bug.cgi?id=675).
The patch works here. Please test.
Thanks.
Darrell
On Tuesday 10 of April 2012 00:36:36 Darrell Anderson wrote:
I posted a patch to starttde in bug report 675 (http://bugs.pearsoncomputing.net/show_bug.cgi?id=675).
The patch works here. Please test.
Thanks.
Darrell
Oops, before I had time to look at it, so you already have a patch ready :) I look at him as soon as possible.
Slavek --
On Tuesday 10 of April 2012 00:36:36 Darrell Anderson wrote:
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.
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 posted a patch to starttde in bug report 675 (http://bugs.pearsoncomputing.net/show_bug.cgi?id=675).
The patch works here. Please test.
Thanks.
Darrell
Lastly I looked at the patch - it looks good. Just one note: $TDEDIR/share/man is "added" to the MANPATH, even when empty. But instead of direct testing MANPATH probably should be checked output from call `manpath`.
Slávek --
Lastly I looked at the patch - it looks good. Just one note: $TDEDIR/share/man is "added" to the MANPATH, even when empty. But instead of direct testing MANPATH probably should be checked output from call `manpath`.
MANPATH test added.
Merged upstream in GIT hash 398ef116.
Thank you!
Darrell
Dne st 11. dubna 2012 Darrell Anderson napsal(a):
Lastly I looked at the patch - it looks good. Just one note: $TDEDIR/share/man is "added" to the MANPATH, even when empty. But instead of direct testing MANPATH probably should be checked output from call `manpath`.
MANPATH test added.
Merged upstream in GIT hash 398ef116.
Thank you!
Darrell
Oops, setting MANPATH is wrong! MANPATH is not only independent variable. He has a relationship with the configuration file /etc/manpath.config - see: man manpath
The problem was not in the colon at end, when value is not set. The colon is desirable there. But, instead in the variable MANPATH must be searched in the result of call 'manpath'.
I add the patch to bug 675.
Slávek --
On Tuesday 10 of April 2012 00:36:36 Darrell Anderson wrote:
I posted a patch to starttde in bug report 675 (http://bugs.pearsoncomputing.net/show_bug.cgi?id=675).
The patch works here. Please test.
Thanks.
Darrell
Hey.
Bad news. Now I finally tested your patch with a loop and awk and starttde crashes - for me. Later, I look at it (now I'm at work).
Slávek --
On Thursday 12 of April 2012 11:50:00 Slávek Banko wrote:
On Tuesday 10 of April 2012 00:36:36 Darrell Anderson wrote:
I posted a patch to starttde in bug report 675 (http://bugs.pearsoncomputing.net/show_bug.cgi?id=675).
The patch works here. Please test.
Thanks.
Darrell
Hey.
Bad news. Now I finally tested your patch with a loop and awk and starttde crashes - for me. Later, I look at it (now I'm at work).
Slávek
Patch added to bug #675 - I did not realize that such a 'for' is a bashism.
Slávek --
Bad news. Now I finally tested your patch with a loop and awk and starttde crashes - for me. Later, I look at it (now I'm at work).
Slávek
Patch added to bug #675 - I did not realize that such a 'for' is a bashism.
Updated in GIT hash 1bd6166b.
Darrell