[MacPorts] #34841: Each MacPorts install adds a $PATH variable even if it already exists; Also, puts it after rvm $PATH variable

MacPorts noreply at macports.org
Tue Jun 12 18:22:44 PDT 2012


#34841: Each MacPorts install adds a $PATH variable even if it already exists;
Also, puts it after rvm $PATH variable
---------------------------------------+------------------------------------
 Reporter:  lawrence.trey@…            |       Owner:  macports-tickets@…                   
     Type:  enhancement                |      Status:  new                                  
 Priority:  Low                        |   Milestone:  MacPorts Future                      
Component:  ports                      |     Version:  2.1.1                                
 Keywords:  $PATH, .bash_profile, rvm  |        Port:                                       
---------------------------------------+------------------------------------

Comment(by ryandesign@…):

 Replying to [ticket:34841 lawrence.trey@…]:
 > Even if the $PATH variable exists for a previous install, MacPorts adds
 another. This won't cause any issues, but it will clutter the
 ~/.bash_profile script.

 That's not supposed to happen.
 [browser:trunk/base/portmgr/dmg/postflight?rev=92903#L241 The code only
 adds the MacPorts path to PATH if it's not already in there]. If that's
 not what you see, then we need your help to diagnose why that might be.

 > Also, the $PATH variable is appended to the ~/.bash_profile script.

 Yes, our intention is that, no matter what paths the user may have set up
 earlier in their profile, we want our path prepended. This ensures that
 MacPorts versions get used instead of system versions.

 > This means that if rvm has been installed, the default rvm ruby version
 is overridden by the $PATH variable for MacPorts. So for each new bash
 session, the native ruby is loaded instead of the default rvm ruby
 version. There should be some logic to check to see if rvm is being used,
 and if so, the MacPorts $PATH variable should be added before rvm is
 loaded.

 I'm unclear on why it would be MacPorts' responsibility to know anything
 about rvm or any other program wanting to modify your shell environment.
 Ultimately, it's the responsibility of the user to set up their profile in
 a way that suits their needs. MacPorts only does a one-time change of the
 user's profile at the time that you originally install MacPorts using the
 package installer, as a convenience to the user, but the user is free to
 change that.

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


More information about the macports-tickets mailing list