MacPorts vs Mac PATH Conflicts - Best Workaround???
joe davison
jwdavison at me.com
Sun Nov 14 16:42:19 PST 2010
Presumably there are a variety of projects you use where which you want to use differs from project to project?
I create project_name.env files in ~/bin where can set the PATH I want for that project. Then whenever I want to work on that project, I create a new terminal window and . project_name.env to set the PATH (and any other variables I want set).
I make it somewhat easier by creating some variables like "STDPATH" in my .profile that have the fixed part of my path, and then the project_name.env file need only prefix / append the different parts to the STDPATH.
Of course, this assumes one works primarily from the command line.
--
joe
joda at ieee.org
On Nov 13, 2010, at 4:59 PM, LeAnne Lis wrote:
> I understand that MacPorts exports /opt/local/bin and /opt/local/sbin in the .profile to ensure its paths go to the front of the env PATH. Apparently this is done because typically Apple has older versions of "stuff" than MacPorts, and, of course, most MacPorts users want to use the new stuff.
>
> What if, however, there is an instance (or two) where a user wants the Apple version to be accessed rather than the MacPorts version? For example, I have seen a post on the web from a person who had issues with Ruby on Rails 'til they put their MacPorts paths at the end of the PATH. I also know a person who is wanting to use Apple's version of Perl - but the MacPorts version was installed as a dependency for something else he uses, so now his Apple version isn't found.
>
> For the moment, I had him put the /opt/local parts at the end of the PATH (renamed his .profile and placed a file with the MacPorts paths in /etc/paths.d). I'm sure this will cause problems with his MacPorts ports, though, since it'll try to use the Apple libraries instead.
>
> So, I'm wondering: has anyone come up with an "elegant" way to handle swapping PATH info as needed for situations like these?
>
> I suppose one could create scripts for the specific version(s) they want to use, but that seems like a pain. Or, perhaps one could create a script just to swap the PATH as needed on the fly. Any other thoughts???
>
>
> View this message in context: MacPorts vs Mac PATH Conflicts - Best Workaround???
> Sent from the MacPorts - Users mailing list archive at Nabble.com.
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20101114/70a75e28/attachment.html>
More information about the macports-users
mailing list