Messed up Perl

Daniel J. Luke dluke at geeklair.net
Mon Oct 4 12:30:37 PDT 2010


On Oct 4, 2010, at 3:21 PM, Hal Vaughan wrote:
> 
>> It's entirely reasonable to assume that
>> someone who has installed MacPorts wants MacPorts programs to be available
>> in their $PATH.  
> 
> You've missed a major point: These programs are OVERRIDING what's already there.  That's my objection.

no, they're not.

Those programs are still there.

>> If you want to change *where* it is in your $PATH, then
>> edit the PATH= line in ~/.profile.  
> 
> Yes, I'll be doing that.  My issue there is that MacPorts PREPENDS their paths to PATH, instead of APPENDING them, making one use MacPorts programs by default, OVER OS X programs that were already there and doing just what I wanted them to do.

... your issue is that MacPorts didn't do what you want automatically.

Historically, we have done three different things with PATH:

1. Nothing (my preferred solution)
 - This results in large numbers of "I installed this with MacPorts and I can't use it" emails to the mailing list
2. Append to the PATH
 - This results in large numbers of "Why isn't the MacPorts _foo_ I installed running instead of the system one" emails to the mailing list
3. Prepend to PATH
 - This results in a few very angry rants from people who are confused about what is happening (and usually it seems to be people running perl who don't realize that there's a difference between /usr/bin/perl and /opt/local/bin/perl and associated modules).

Prepend to PATH seems to enable behavior that most of our users expect - and it's easy enough for those who want other behavior to change their own path.

If you have a better solution, I'm sure we're happy to hear it. 

> If I run cpan, without prefacing it with "/usr/bin/", I should be able to count on it being the default executable, not one that has been doctored.

It's not a 'doctored' one, it's just that your PATH isn't what you expect, and you didn't think to look at your PATH or do 'which cpan' or 'which perl' when things didn't work the way you expected.

> As best I can remember, at no place, when installing anything, did MacPorts warn me, "Hey, guy, we're usurping your defaults by putting our path BEFORE yours, so you'll always run our stuff over the defaults now."

I haven't installed from the .dmg installer in a long time, but it should probably mention this. It would be super-awesome if you would contribute to the community of volunteers who make MacPorts happen if you could submit bug reports like this last sentence to our bug tracker (and even better if you feel motivated enough to figure out how to fix the problem and submit the fix as well).

--
Daniel J. Luke                                                                   
+========================================================+                        
| *---------------- dluke at geeklair.net ----------------* |                          
| *-------------- http://www.geeklair.net -------------* |                          
+========================================================+                        
|   Opinions expressed are mine and do not necessarily   |                          
|          reflect the opinions of my employer.          |                          
+========================================================+





More information about the macports-users mailing list