[OS X TeX] If you have...

Peter Dyballa Peter_Dyballa at Web.DE
Fri Mar 6 19:11:30 CET 2009


Am 06.03.2009 um 16:42 schrieb Herbert Schulz:

> In all cases I need to know which shell you use as well as the full  
> file path (~ for HOME) and contents added to the file.


Herb,

the shell plays no roll. The install scripts take care for this, the  
(t)csh, and also the other, the (ba,z)sh, flavour.

And it's not so hard to gain exact information. Fetching the install  
images you can find inside (Apple or Mac OS X) install packages.  
Charles Srstka's shareware Pacifist (http://www.charlessoft.com/)  
allows, as if you were on the command line, to look into the PKG file  
and see all its components. Well, some UNIX understanding is needed  
now to get an idea of how the installation process might work, which  
script probably ("postflight") will be used, so in short:

	Fink does not alter any non-Fink or user file.

Fink instead recommends in a detailed way to its user to take one or  
two steps to set up its environment. See here: http:// 
www.finkproject.org/doc/users-guide/install.php?phpLang=en#setup.

There is an application inside the Fink installation image,  
pathsetup. If the user chooses to use this application to update his  
or her environment, the application decides on the kind of login  
shell which files in which sequence will be altered:

   for (t)csh:
     1. ~/.tcshrc
     2. ~/.cshrc

   for bash:
     1. ~/.bash_profile
     2. ~/.bash_login
     3. ~/.profile

If none of these files exists, for (t)csh the file ~/.cshrc is  
created, for a bash the file ~/.profile.

In the case of (t)csh the line

	test -r /sw/bin/init.csh && source /sw/bin/init.csh

and in the case of bash the line

	test -r /sw/bin/init.sh && . /sw/bin/init.sh

is appended to the found RC file. Users of any other shell (zsh, ksh,  
ash, rc, es, ...) won't receive Fink support (I think users of *sh  
can easily use the bash line addition).


MacPorts (http://trac.macports.org/wiki) claims in the (English)  
ReadMe.rtf inside the disk image:

	A file named ~/.profile is created for the "bash" shell (default on  
Mac OS X 10.3 and newer) during the MacPorts installation. It  
contains the necessary statements to append MacPorts' binary paths  
within /opt/local/ to your shell environment, so MacPorts is  
available to you on subsequent terminal sessions. You may have to  
quit and restart your terminal application for this change to take  
effect.

Actually it's not completely true: for me tcsh user a file ~/.tcshrc  
was created. The user of a csh, sh, zsh, ksh, or any other shell (rc,  
es, ash, ...) as login shell will not get MacPorts "support," i.e.,  
they will have set up their environment manually (again, for *sh  
shells the bash lines can be used). (The way to determine the user's  
login shell is quite clever and exact: dscl . -read /users/${USER}  
shell | awk -F'/' '{print $NF}'.)

In case of tcsh MacPorts appends these lines

	# MacPorts Installer addition on YYYY-MM-DD_at_HH:MM:SS: adding an  
appropriate PATH variable for use with MacPorts.
	setenv PATH /opt/local/bin:/opt/local/sbin:$PATH
	# Finished adapting your PATH environment variable for use with  
MacPorts.
	
	
	# MacPorts Installer addition on YYYY-MM-DD_at_HH:MM:SS: adding an  
appropriate DISPLAY variable for use with MacPorts.
	setenv DISPLAY :0
	# Finished adapting your DISPLAY environment variable for use with  
MacPorts.

to an existing or newly created ~/.tcshrc file and in case of bash it  
might be:

	# MacPorts Installer addition on YYYY-MM-DD_at_HH:MM:SS: adding an  
appropriate PATH variable for use with MacPorts.
	export PATH=/opt/local/bin:/opt/local/sbin:$PATH
	# Finished adapting your PATH environment variable for use with  
MacPorts.
	
	
	# MacPorts Installer addition on YYYY-MM-DD_at_HH:MM:SS: adding an  
appropriate DISPLAY variable for use with MacPorts.
	export DISPLAY=:0
	# Finished adapting your DISPLAY environment variable for use with  
MacPorts.

which is appended to ~/.profile. (I do miss MANPATH in both!) The  
function write_setting() which does the update is this one:

     echo -e "\n# ${OUR_STRING}: adding an appropriate ${1} variable  
for use with MacPorts." >> ${HOME}/.${CONF_FILE}
     echo "${ENV_COMMAND} ${1}${ASSIGN}${2}" >> ${HOME}/.$ 
{CONF_FILE}    echo -e "# Finished adapting your ${1} environment  
variable for use with MacPorts.\n" >> ${HOME}/.${CONF_FILE}
     chown ${USER} ${HOME}/.${CONF_FILE} || echo "Warning: unable to  
adapt permissions on your ${HOME}/.${CONF_FILE} shell configuration  
file!"
     echo "An appropriate ${1} variable has been added to your shell  
environment by the MacPorts installer."

which is invoked as

	write_setting PATH "${BINPATH}:${SBINPATH}:\$PATH"

and ENV_COMMAND, ASSIGN, and CONF_FILE set for each of the two cases.

So MacPorts changes at once the user's environment. Both, MacPorts  
and Fink, are less invasive then any of the Mac specific TeX  
distributions which all dare to alter the whole system.


Since the Fink and MacPorts settings come last, they override  
previous values of PATH. So if a TeX Live and Fink user invokes in  
the standard install environment tex or latex, it will be Fink's  
teTeX 3 which will be used. This situation can be changed in the  
altered login shell RC file and/or by invoking

	env PATH=<path to TeX Live's binaries directory:$PATH latex ...

or

	env PATH=/sw/bin:$PATH latex ...

to use either TeX Live or teTeX.

--
Greetings

   Pete

We have to expect it, otherwise we would be surprised.






More information about the macostex-archives mailing list