I have found a curiousity.. this is probably not super important, but I can't stand not understanding this.
why does my PKG_CONFIG_PATH seem to keep getting longer & longer?
if I do 'echo $PKG_CONFIG_PATH'
as myself, from the console:
Code:
/opt/gEDA/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/opt/kde/lib/pkgconfig
as root from the console:
Code:
/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/opt/kde/lib/pkgconfig
as myself, from terminal in xfce:
Code:
/opt/gEDA/lib/pkgconfig:/opt/gEDA/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/opt/kde/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/kde/lib/pkgconfig
and as root, from terminal in xfce:
Code:
/opt/gEDA/lib/pkgconfig:/opt/gEDA/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/opt/kde/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/kde/lib/pkgconfig
I guess I understand that 'su' from inside xfce _should_ inherit the environment vars from the terminal because they are all set when I open it? But I don't understand why the line grows between the console and X session, other than this I found :
Code:
# cat /etc/profile.d/pkgconfig.sh
#!/bin/sh
if [ ! "$PKG_CONFIG_PATH" = "" ]; then
PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/kde/lib/pkgconfig
else
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/opt/kde/lib/pkgconfig
fi
export PKG_CONFIG_PATH
so is it like every terminal opened in X will go through the profile.d scripts and since $PKG_CONFIG_PATH is defined it keeps appending the standard directories? (my theory)
Why? It seems this is incorrect and should only set PKG_CONFIG_PATH once and let the user's .bash_profile or CLI modify it as needed.
Is there another reason I don't know of for doing it this way?
Does it bother anyone else? Does it matter anyway?
many thanks!