diff options
author | Darrell Anderson <[email protected]> | 2012-04-10 21:57:23 -0500 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2012-04-10 21:57:23 -0500 |
commit | 398ef1163c368dc64e70d70ffbd9bb0f3f2104f9 (patch) | |
tree | 7e22b16c9a99011ccb5a544207cd9a4e039227c9 | |
parent | 56afd422f13b321c569c4d5e2e2f6a6644ebe449 (diff) | |
download | tdebase-398ef1163c368dc64e70d70ffbd9bb0f3f2104f9.tar.gz tdebase-398ef1163c368dc64e70d70ffbd9bb0f3f2104f9.zip |
Updated starttde to ensure $TDEDIRS is parsed correctly to $XDG_DATA_DIRS and
updated to test for $MANPATH before appending that environment variable.
-rw-r--r-- | starttde | 34 |
1 files changed, 26 insertions, 8 deletions
@@ -169,6 +169,15 @@ if [ -d $TDEDIR/bin ]; then fi fi fi +if [ -d $TDEDIR/share/man ]; then + if [ "$MANPATH" = "" ]; then + export MANPATH=$TDEDIR/share/man + else + if [ "`echo $MANPATH | grep \"$TDEDIR/share/man\"`" = "" ]; then + export MANPATH=$TDEDIR/share/man:$MANPATH + fi + fi +fi if [ "$XDG_CONFIG_DIRS" = "" ]; then if [ -d /etc/xdg ]; then @@ -197,7 +206,7 @@ if [ -d $TDE_XDG_DIR ]; then if [ "$XDG_CONFIG_DIRS" = "" ]; then XDG_CONFIG_DIRS=$TDE_XDG_DIR else - XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:$TDE_XDG_DIR + XDG_CONFIG_DIRS=$TDE_XDG_DIR:$XDG_CONFIG_DIRS fi fi fi @@ -207,24 +216,33 @@ fi # Explicitly set $XDG_DATA_DIRS only when Trinity is not installed in /usr. # Explicitly declaring $XDG_DATA_DIRS will override the default search path of /usr/share. +# Explicitly declaring $XDG_DATA_DIRS will override $TDEDIRS, which must then be +# explicitly identified in the $XDG_DATA_DIRS string to remain useful. +# The $TDEDIR variable is intended to be singular and $TDEDIRS plural. When $TDEDIRS +# exists in the environment then parse that variable into separate directories. +# $TDEDIRS should contain whatever is set in $TDEDIR. Therefore any additional directories +# set in $TDEDIRS are intended to override data files found in $TDEDIR. Those additional +# directories should be placed before $TDEDIR and before /usr/share. if [ "$TDEDIR" != "/usr" ] && [ -d $TDEDIR/share ]; then if [ "$XDG_DATA_DIRS" = "" ]; then # Ensure the standard location of /usr/share is included. XDG_DATA_DIRS=/usr/share else if [ "`echo $XDG_DATA_DIRS | grep \"/usr/share\"`" = "" ]; then - XDG_DATA_DIRS=/usr/share:$XDG_DATA_DIRS + XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share fi fi if [ "`echo $XDG_DATA_DIRS | grep \"$TDEDIR/share\"`" = "" ]; then - XDG_DATA_DIRS=$XDG_DATA_DIRS:$TDEDIR/share + XDG_DATA_DIRS=$TDEDIR/share:$XDG_DATA_DIRS fi - export XDG_DATA_DIRS -fi -if [ -d $TDEDIR/share/man ]; then - if [ "`echo $MANPATH | grep \"$TDEDIR/share/man\"`" = "" ]; then - export MANPATH=$TDEDIR/share/man:$MANPATH + if [ "$TDEDIRS" != "" ]; then + for ((i=`echo $TDEDIRS | awk -F : '{print NF}'`;i>=1;i--)); do + if [ "`echo $XDG_DATA_DIRS | grep \"\`echo $TDEDIRS | cut -d: -f${i}\`\"`" = "" ]; then + XDG_DATA_DIRS=`echo $TDEDIRS | cut -d: -f${i}`/share:$XDG_DATA_DIRS + fi + done fi + export XDG_DATA_DIRS fi test -n "$TDEHOME" && tdehome=`echo "$TDEHOME" | sed "s,^~/,$HOME/,"` |