Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 242360 - kde-base/kdebase-startkde-4.1.2-r1 breaks PATH order
Summary: kde-base/kdebase-startkde-4.1.2-r1 breaks PATH order
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-16 17:35 UTC by Matt Whitlock
Modified: 2009-02-21 19:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to /usr/bin/startkde to fix the problem (startkde.patch,836 bytes, patch)
2009-02-15 03:45 UTC, Lawrence D'Oliveiro
Details | Diff
patch to /usr/portage/kde-base/kdebase-startkde/files/gentoo-startkde4.patch to fix the problem (gentoo-startkde4.patch.patch,915 bytes, patch)
2009-02-15 03:46 UTC, Lawrence D'Oliveiro
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2008-10-16 17:35:01 UTC
With USE=-kdeprefix, startkde breaks the PATH order by moving /usr/bin to the front of the PATH, ahead of /usr/local/bin.  Thus, binaries in /usr/local/bin that are intended to override like-named binaries in /usr/bin are no longer the ones chosen by path search.
Comment 1 Lawrence D'Oliveiro 2009-02-15 02:20:05 UTC
Just confirming this happens with kde-base/kdebase-startkde/kdebase-startkde-4.2.0 as well. The cause seems to be these first three non-comment lines in /usr/bin/startkde:

_KDEDIR=/usr
export PATH=${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
export ROOTPATH=${_KDEDIR}/sbin:${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')

The second and third lines should not be executed if _KDEDIR has the value "/usr", as it does in this case.
Comment 2 Lawrence D'Oliveiro 2009-02-15 03:44:02 UTC
Here's a patch to /usr/bin/startkde:

--- startkde-orig       2009-02-08 17:53:22.000000000 +1300
+++ startkde    2009-02-15 16:36:00.000000000 +1300
@@ -8,8 +8,10 @@
 trap 'echo GOT SIGHUP' HUP

 _KDEDIR=/usr
-export PATH=${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
-export ROOTPATH=${_KDEDIR}/sbin:${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
+if [ "$_KDEDIR" != "/usr" ]; then
+       export PATH=${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
+       export ROOTPATH=${_KDEDIR}/sbin:${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
+fi

 export STRIGI_PLUGIN_PATH="${_KDEDIR}/lib64/strigi:${STRIGI_PLUGIN_PATH}"
 export XDG_DATA_DIRS=${_KDEDIR}/share:$(echo ${XDG_DATA_DIRS} | sed 's/$/:/g;s#/usr/kde/[^/]*/share/\?:##g;s/:$//g')

Or if you prefer, here's one to /usr/portage/kde-base/kdebase-startkde/files/gentoo-startkde4.patch:

--- gentoo-startkde4.patch-orig 2008-10-05 11:06:04.000000000 +1300
+++ gentoo-startkde4.patch      2009-02-15 16:36:39.000000000 +1300
@@ -5,8 +5,10 @@
  trap 'echo GOT SIGHUP' HUP

 +_KDEDIR=@REPLACE_PREFIX@
-+export PATH=${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
-+export ROOTPATH=${_KDEDIR}/sbin:${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
++if [ "$_KDEDIR" != "/usr" ]; then
++      export PATH=${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
++      export ROOTPATH=${_KDEDIR}/sbin:${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
++fi
 +@REPLACE_LDPATH@
 +export STRIGI_PLUGIN_PATH="${_KDEDIR}/@REPLACE_LIBDIR@/strigi:${STRIGI_PLUGIN_PATH}"
 +export XDG_DATA_DIRS=${_KDEDIR}/share:$(echo ${XDG_DATA_DIRS} | sed 's/$/:/g;s#/usr/kde/[^/]*/share/\?:##g;s/:$//g')
Comment 3 Lawrence D'Oliveiro 2009-02-15 03:45:24 UTC
Created attachment 182088 [details, diff]
patch to /usr/bin/startkde to fix the problem
Comment 4 Lawrence D'Oliveiro 2009-02-15 03:46:08 UTC
Created attachment 182090 [details, diff]
patch to /usr/portage/kde-base/kdebase-startkde/files/gentoo-startkde4.patch to fix the problem
Comment 5 Ryan Hill (RETIRED) gentoo-dev 2009-02-21 19:07:25 UTC
fixed in 4.2.0-r1.