diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2025-09-04 08:57:09 +0300 |
---|---|---|
committer | Alexander Golubev <fatzer2@gmail.com> | 2025-09-04 08:57:09 +0300 |
commit | e8f65d65c6e1bf9f80eed93fb92c9670dcd38a73 (patch) | |
tree | f4b4d8267f7834b8c64231635b32e5e4f1745f93 | |
parent | dad866a20414ea73150c8b8c6082b5c2c2fa99ec (diff) | |
download | tdebase-feat/starttde-issue-322-split.tar.gz tdebase-feat/starttde-issue-322-split.zip |
starttde: make adding games to PATH conditionalfeat/starttde-issue-322-split
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
-rwxr-xr-x | starttde | 29 |
1 files changed, 17 insertions, 12 deletions
@@ -214,18 +214,23 @@ if [ "$TDEROOTHOME" = "" ]; then fi # Modify the PATH environment variable only as necessary. -if ! is_in_path PATH "$TDEDIR/games" ; then - # Respect the traditional path order. Don't blindly place $TDEDIR/games - # first in the path. Only place $TDEDIR/games before /usr/games. If packagers - # are adding $TDEDIR/games elsewhere, then they need to ensure the traditional - # search patch is respected. - # This order is consistent with tdelibs/tdesu/stub.cpp. - # FIXME: Is there a way to check that $TDEDIR/games is always placed only - # just before /usr/games in the search path? - if is_in_path PATH "/usr/games"; then - place_before_in_path PATH "$TDEDIR/games" "/usr/games" - else - export PATH=$TDEDIR/games:$PATH +if [ -d /usr/games -o -d "$TDEDIR/games" ] || is_in_path PATH "/usr/games"; then + # Some distributions (e.g. Gentoo) don't use a separate directory for games. + # So don't add it to PATH unless there are any indications that in might be + # actually needed. + if ! is_in_path PATH "$TDEDIR/games" ; then + # Respect the traditional path order. Don't blindly place $TDEDIR/games + # first in the path. Only place $TDEDIR/games before /usr/games. If packagers + # are adding $TDEDIR/games elsewhere, then they need to ensure the traditional + # search patch is respected. + # This order is consistent with tdelibs/tdesu/stub.cpp. + # FIXME: Is there a way to check that $TDEDIR/games is always placed only + # just before /usr/games in the search path? + if is_in_path PATH "/usr/games"; then + place_before_in_path PATH "$TDEDIR/games" "/usr/games" + else + export PATH=$TDEDIR/games:$PATH + fi fi fi |