On Mon, 22 Feb 2010, Martin Costabel wrote:

> The weird PATH you get in your situation (4) is the result of /etc/profile 
> executing `/usr/libexec/path_helper -s`. On 10.5, the path_helper script was 
> a (very complicated) shell script, on 10.6 it is a compiled executable, so I 
> don't quite know what it does, but it seems it now prepends the contents of 
> /etc/paths and of the files in /etc/paths.d to $PATH. On 10.5 it placed these 
> things at the end of $PATH.
> Normally, the subsequent ~/.bash_profile script would clean up the mess by 
> running Fink's init.sh. I don't know why it doesn't do this in your case.

It seems indeed that path_helper is messing up my PATH: in an xterm
invoked without -ls (from the X11 Applications menu), this happens:

bash-3.2$ echo $PATH
/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/X11R6/bin:/usr/X11/bin
bash-3.2$ eval `/usr/libexec/path_helper -s`
bash-3.2$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/sw/bin:/sw/sbin:/usr/X11R6/bin

The contents of /etc/paths is
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

and /etc/paths.d/ contains two files with the following contents:
TeX: /usr/texbin
X11: /usr/X11/bin

Apparently path_helper tries to construct a new path by taking
the contents of /etc/paths first, then appending what is found in
/etc/paths.d, to continue with whatever other directories are found
in the existing PATH. I would expect path_helper to append an existing
path if necessary, but not to rearrange it. The man page states that
it "appends" so this is not correct.

I don't see why /sw/bin/init.sh would clean up all this: as far as
I can see it only prepends /sw/bin:/sw/sbin to the PATH if that string 
is not already present (at least in my version of the script, which 
was installed along with fink and never modified by me).

Since this is my mac I can change whatever I want to make it work
correctly. I could modify system files in /etc or replace path_helper
with Leopard's version but maybe this can be overwritten by system
updates. Maybe I'll just construct my own path in .bash_profile and
check now and then whether some future update will change things.

Thanks for all your very useful comments.

Patrick

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Fink-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to