diff options
| author | Alexander Golubev <fatzer2@gmail.com> | 2025-09-04 08:57:09 +0300 |
|---|---|---|
| committer | Alexander Golubev <fatzer2@gmail.com> | 2025-10-24 17:15:30 +0300 |
| commit | a53681f35e65dd364c0b9fa608f5d2d99fadaebc (patch) | |
| tree | 93885e72d03013087fdbbb64efa1be9eac50e444 /starttde | |
| parent | 7bf546b27b8cf52effdafbabd2161d506ffeb04d (diff) | |
| download | tdebase-a53681f3.tar.gz tdebase-a53681f3.zip | |
starttde: make adding games to PATH conditional
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 2a6d54be85d65653a4272c641e4ac0c8af91dfe5)
Diffstat (limited to 'starttde')
| -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 |
