Added support in MacPorts base to set PATH and MANPATH automatically in Leopard

James Berry jberry at macports.org
Thu Nov 29 06:13:08 PST 2007


Hi Adam,

On Nov 29, 2007, at 5:49 AM, Adam Mercer wrote:
> On 25/11/2007, James Berry <jberry at macports.org> wrote:
>>
>> On Nov 25, 2007, at 1:14 PM, James Berry wrote:
>>
>>> I just checked in some code (r31491:31492) that supplies and
>>> installs spec files for the /etc/paths.d  and /etc/manpaths.d
>>> directories if they are present, as they are on Leopard.
>>>
>>> The contents of these files are automatically added to the users
>>> PATHS and MANPATHS environment variables, and should mean that we
>>> don't need to configure the user's profile under Leopard. Note that
>>> support for this is though path_helper(8).
>>
>> Note that paths added through this mechanism are added at the  
>> _end_of_
>> the PATH and MANPATH variables, and so won't automatically override
>> any system-supplied commands.
>
> Is there a way to turn this off? i.e. I want to have
> /opt/local/{bin,sbin} in my PATH before /usr/{bin,sbin}.  At the
> moment I add these explicitly myself, but since this change
> /opt/local/{bin,sbin} are in my PATH twice.

The only way to turn it off is to manually remove or modify the files  
installed by macports. Note that having the paths in your PATHs twice  
shouldn't hurt anything and probably adds minimal performance slowdown  
only in the failure case.

One enhancement we could potentially make would be to not overwrite  
versions of these files. That way, if you remove their contents once,  
subsequent versions of MacPorts would not overwrite you change. The  
downside of that is that if we wanted to push out changes to these  
files, it would be less-clear how to update existing users.

Comments, anyone?

James


More information about the macports-dev mailing list