[OS X TeX] Leopard MacTeX PATH problems, still

Anthony Morton amorton at fastmail.fm
Sun Mar 23 05:31:16 CET 2008


> The /usr/libexec/path_helper utility is itself a shell script that  
> takes care of parsing /etc/paths.d/; one interesting thing to note  
> is that any paths in the text file /etc/paths will get processed  
> ahead of the remaining paths.
> So if there is anything in that file that might cause trouble by  
> coming first, then you must either chance editing (and remembering) / 
> etc/paths, or else you must shortcut the default behavior by having  
> your system-wide shell file NOT call path_helper, and then call it  
> manually AFTER you have set the other paths first.

It's more subtle even than that.  Anything that's in the shell's  
initial PATH before path_helper is called (eg. from /etc/profile) will  
always appear first, regardless of the order in /etc/paths.

In practice this means that /usr/bin, /bin, /usr/sbin and /sbin will  
always come first in a Leopard PATH, unless a script alters PATH  
directly.

This means that if you install your own version of an Apple-supplied  
utility, for example a custom 'tar' in /usr/local/bin, then the shell  
will continue to prefer the Apple-supplied version unless you invoke  
it expicitly as /usr/local/bin/tar.

People have complained that this is the opposite of the 'conventional'  
Unix approach, where locally-managed hierarchies like /usr/local/bin  
come first in PATH.  This way, a local user runs 'tar' and gets  
whatever version of tar is deemed locally appropriate, while those  
wanting 'factory default' behaviour invoke /usr/bin/tar explicitly.

The path_helper way of doing it means that 'tar' is guaranteed to give  
you the vendor's supplied tar no matter what, so is helpful from this  
perspective; but of course this guarantee breaks as soon as you go to  
a non-Leopard system, or as soon as a user hacks their own PATH.  '/ 
usr/bin/tar' is still the only way to access the default tar that's  
always guaranteed to work.  Meanwhile, anyone wanting a local  
alternative tar must run /usr/local/bin/tar: so arguably you're  
requiring more work from some users while not reducing the work  
required by others.

The distinction of course only matters where someone is installing  
their own version of a supplied utility - it doesn't matter for TeX or  
anything else that doesn't arrive out of the box.

Tony M.




More information about the macostex-archives mailing list