[MacPorts] #20524: base-1.7.1 Neater PATH change process for Postflight

MacPorts noreply at macports.org
Sun Aug 2 14:21:17 PDT 2009


#20524: base-1.7.1 Neater PATH change process for Postflight
-------------------------------------+--------------------------------------
 Reporter:  alex@…                   |       Owner:  macports-tickets@…                   
     Type:  enhancement              |      Status:  new                                  
 Priority:  Normal                   |   Milestone:  MacPorts Future                      
Component:  base                     |     Version:  1.7.1                                
 Keywords:  PATH profile postflight  |        Port:                                       
-------------------------------------+--------------------------------------
 In a basic install of MacPorts 1.7.1 on clean Leopard, my .profile didn't
 get updated with the required PATH adjustments for /opt/local - so I
 decided to do it myself. In looking through the various 'profile' files in
 /etc - for all the different shells (csh, bash, tcsh, zsh, etc.) - they
 all have code in them to run /usr/libexec/path_helper.

 This is a script that reads two files in /etc - /etc/paths and
 /etc/manpaths which are simple text files containing a list of paths to be
 added to $PATH when the shell environment is set up.

 Instead of the extra code in the postflight script to determine what shell
 is used etc. to add the MacPorts paths to $PATH, wouldn't it be just much
 neater to add the two paths to the /etc/paths file? Then you'd always have
 access to the MacPorts apps regardless of what shell you use in OS X,
 because Apple have ensured that this /usr/libexec/path_helper is run
 across all shells.

 This may be Leopard-only, and if you don't consider a global $PATH
 modification appropriate then feel free to cancel this ticket, but I feel
 it'd be a useful solution for many MacPorts users, and certainly would
 simplify the postflight. I still get occasional non-editing of .profile
 when running the current package.

 I prepended the two paths /opt/local/bin and /opt/local/sbin to the
 /etc/paths file, and on opening a Terminal window (regardless of shell - I
 tried bash, zsh, tcsh and sh), the MacPorts folders were in the $PATH
 variable and I could run MacPorts code. Nice and easy and more elegant
 than hacking .profile files, which may already be extensively hacked by
 the users themselves.

 Just a suggestion, and I'm a complete newbie to this bug tracker system so
 apologies if this is in the wrong place. Please allocate to the right
 location! cheers, Alex

-- 
Ticket URL: <http://trac.macports.org/ticket/20524>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list