[MacPorts] #30458: Better PATH setup

MacPorts noreply at macports.org
Fri Jul 29 15:41:11 PDT 2011


#30458: Better PATH setup
---------------------------------+------------------------------------------
  Reporter:  ydeedido@…          |       Owner:  macports-tickets@…                   
      Type:  enhancement         |      Status:  closed                               
  Priority:  Normal              |   Milestone:                                       
 Component:  base                |     Version:  2.0.0                                
Resolution:  wontfix             |    Keywords:                                       
      Port:                      |  
---------------------------------+------------------------------------------
Changes (by ryandesign@…):

  * status:  new => closed
  * component:  ports => base
  * milestone:  MacPorts 2.0.1 =>
  * keywords:  install uninstall =>
  * resolution:  => wontfix


Old description:

> There must be a reason for doing things the way they are but I prefer to
> add the path to the /etc/paths.d directory (instead of modifying the user
> profile which only works for that user). Since macports is installed
> under /opt/include which is not a user specific directory, would it not
> be better to make the PATH environment work for all users? (I often login
> as root)
>
> Anyway, the suggestion is to create a file called 99_MacPorts under
> /etc/paths.d which only contains two lines:
> /opt/local/bin
> /opt/local/sbin
> When one wants to un-install MacPorts, simply delete that file.
>
> I like to name all my files under /etc/paths.d with a number so the paths
> get added by numerical order. In my case 99_MacPorts is parsed last and
> thus the path is appended at the end of my PATH variable though I seem to
> understand some people like it first? Then name it 01_MacPorts.
>
> Anyway, just a suggestion.. unless I'm missing something.

New description:

 There must be a reason for doing things the way they are but I prefer to
 add the path to the /etc/paths.d directory (instead of modifying the user
 profile which only works for that user). Since macports is installed under
 /opt/include which is not a user specific directory, would it not be
 better to make the PATH environment work for all users? (I often login as
 root)

 Anyway, the suggestion is to create a file called 99_MacPorts under
 /etc/paths.d which only contains two lines:
 {{{
 /opt/local/bin
 /opt/local/sbin
 }}}
 When one wants to un-install MacPorts, simply delete that file.

 I like to name all my files under /etc/paths.d with a number so the paths
 get added by numerical order. In my case 99_MacPorts is parsed last and
 thus the path is appended at the end of my PATH variable though I seem to
 understand some people like it first? Then name it 01_MacPorts.

 Anyway, just a suggestion.. unless I'm missing something.

--

Comment:

 This was debated years ago and found to be unsuitable because a path in
 /etc/paths.d ''appends'' to the existing list of paths, whereas to achieve
 the functionality our users expect, we want to ''prepend'' to the path.

-- 
Ticket URL: <https://trac.macports.org/ticket/30458#comment:1>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list