Environment Problems with Macports (PB G4, OS X 10.5)
Sunday, July 6th, 2008I’m running OS X 10.5 Leopard on a G4 PowerBook, and I was having some issues making Macports work.
When i installed from GUI, using the Macports 1.6.0 .dmg version, at the end of installation I got something like “Installation Failed” which I slowly figured out to possibly be due to problems with my bash environment, since it was the post-flight script at the end of the installation process which could not be executed correctly - setting the PATH and MANPATH values is one of its jobs. This got affirmed by my bash environment missing the required settings.
Changing those manually usually is quite easy. On opening a bash shell, the .profile script would be executed. It would contain two Macports-related lines, namely:
export PATH=/opt/local/bin:/opt/local/sbin:$PATHexport MANPATH=/opt/local/share/man:$MANPATH
Anyway, this did not work on my system. I miss the .profile file at all, and creating it with the required entries does not change a thing. Leopard seems to have brought some changes that other users were experiencing as well. Actually, there is some posting on this issue, but it’s mainly inconclusive. On my friend’s machine (10.5, Intel) it just seems to work that way. So the problem seems to lie in the fact that different systems can have different bash scripts (~/.bash_profile, ~/.bash_login, ~/.profile …).
That all really confused me. Fortunately, I met the mighty Christoph Lischka yesterday ^^. My problem is solved now, Macports up and running, my mind can peacefully flow over with what I found out:
The bash startup scripts are executed in this order: First, the /etc/bashrc, which is a system-wide setting and which I was recommended not to change at all. Second, ~/.bash_profile. Anyway, the X Windows system evaluates ~/.bashrc first. So here’s what the latter two files look like now:
~/.bash_profile:source .bashrc
~/.bashrc:export PATH=/opt/local/bin:/opt/local/sbin:$PATHexport MANPATH=/opt/local/share/man:$MANPATH