problem with PATH defined in .profile and environment.plist

Tim Visher tim.visher at gmail.com
Wed Jan 12 04:00:29 PST 2011


Hi Phillip,

On Tue, Jan 11, 2011 at 5:47 PM, heapifyman wrote:
> I had specified a few environment variables in my
> ~/.MacOXS/environment.plist and also adapted my PATH variable there to
> append my defined env variables.
> This does somehow not work well with the "export PATH=..." that macports
> adds to the ~/.profile file.
>
> I think I read somewhere that the environment.plist should be the place to
> define these kinds of things on Mac OS X.
> I know I can add the things that macporst adds to the PATH in my
> environment.plist and comment out the "export PATH ..." in .profile but I
> guess this will be added again once macports updates itself?
>
> Is there a way to make these two work together?

I think you're going to need to be a little more specific as far as
the exact problems you're seeing.  I also define my environment
variables in `environment.plist` (to support an Emacs installation)
and I haven't seen any issues as far as my PATH is concerned.

You're only half right.  If programs other than Terminal.app (and apps
started from there) need to see the environment variables you're
setting, then you need to define them in  `environment.plist`.
However, if Terminal.app is all that needs to see it, then you're
perfectly fine setting it in your `.profile`.

To preemptively answer the 'problem' you might be seeing, if you're
noticing that your `PATH` contains duplicate entries because you've
set them in `environment.plist` and in `~/.profile`, you've got
nothing to worry about. I know it's not very DRY but `bash` happily
lets you add duplicates to `PATH` and deals with it quite efficiently.
 If that's the problem you're noticing I suggest you stop worrying and
learn to love them bomb.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail


More information about the macports-users mailing list