summaryrefslogtreecommitdiffstats
path: root/trinity-base/tdebase-starttde/files/tdebase-starttde-14-gentoo.patch
blob: 0b53033c879f251f4d8a310e6c0742d99ff5979f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
diff --git a/starttde b/starttde
index 66360e228..512bff7d5 100755
--- a/starttde
+++ b/starttde
@@ -3,18 +3,6 @@
 #  DEFAULT TRINITY STARTUP SCRIPT
 #
 
-# This block might not be appropriate for all systems.
-# It should work for command line logins but graphical
-# login managers might already source these files.
-# Multiple sourcing is not a problem when the files are only
-# containers for environment variables and such.
-if [ -r /etc/xprofile ]; then
-  . /etc/xprofile
-fi
-if [ -r $HOME/.xprofile ]; then
-  . $HOME/.xprofile
-fi
-
 # Some functions to parse and check path correctly ...
 # Usage: is_in_path PATH /usr/bin
 is_in_path() {
@@ -68,6 +56,31 @@ remove_from_path() {
   eval export $var=${NPATH#:}
 }
 
+# Gentoo: In Gentoo $TDE_DIR/bin is in PATH by default, but it's located after /usr/bin,
+#         so to avoid running kf5 apps instead of TDE's one make sure it goes first
+
+TDE_BIN_DIR="$(dirname -- "$0")"
+if ! is_before_in_path PATH "$TDE_BIN_DIR" "/usr/bin"; then
+  remove_from_path PATH "$TDE_BIN_DIR"
+  place_before_in_path PATH "$TDE_BIN_DIR" "/usr/bin"
+fi
+unset TDE_BIN_DIR
+
+# Gentoo: to avoid messing PATH that user might have set we moved .xprofile
+#         import here rather from the very begining of the script
+#
+# This block might not be appropriate for all systems.
+# It should work for command line logins but graphical
+# login managers might already source these files.
+# Multiple sourcing is not a problem when the files are only
+# containers for environment variables and such.
+if [ -r /etc/xprofile ]; then
+  . /etc/xprofile
+fi
+if [ -r $HOME/.xprofile ]; then
+  . $HOME/.xprofile
+fi
+
 # Portable alternative to the file operator -nt (among shells)
 is_newer() {
   if test -n "$(find $1 -prune -newer $2 -print)"
@@ -205,19 +218,21 @@ fi
 
 # Modify the following environment variables 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.
-    # Is there a way we can 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
+# Gentoo: there is no */games/bin directories in gentoo
+#
+#  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.
+#    # Is there a way we can 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
 
   if ! is_in_path PATH "$TDEDIR/bin" ; then
     # Respect the traditional path order. Don't blindly place $TDEDIR/bin