[OS X TeX] Switcher
jkock at start.no
Sun Nov 26 16:58:22 EST 2006
>From the readme of Claus Gerhardt's Switcher:
> The buttons are self-explanatory, the one named "Rm local profiles" starts
> a script that removes the local profiles ".profile" resp. ".tcshrc" in
> your home directory provided they exist.
Claus, I do admire your strong nerves! -- you live dangerously. With what
right would you remove another user's .profile?! A .profile file is where
all the user's configuration of the shell is stored, including for example
prompts, aliases, environment settings, and some of these environment
settings may be paths to other programs' initialisation files. This file
is much more than just a place to override the typically very meager
/etc/profile -- removing this file may blow the user's setup completely.
As a very concrete example which may affect many users: Fink writes a
line in ~/.profile like this:
test -r /sw/bin/init.sh && . /sw/bin/init.sh
whose purpose it is to put Fink's path into PATH and set a couple of other
environment variables needed by Fink.
By removing the .profile file you break all programs installed by Fink!
> This would be necessary, if you had installed the corresponding files
> coming with this distribution to override the system wide path.
Necessary?! That depends of course on the scripter's skills. Gerben's
setpath script, for example, uses a 'signature' which enables it to
identify its own lines of ~/.profile, and overwrite only that part. You
can look in Gerben's script, it is inside the MacTeX installer bundle.
Unfortunately it is writtten in Perl, so it is somewhat hard to read...
Now in your case it seems that the problem is that the user might have a
path defined you don't want him to have, or something... As a rule of
thumb I would say that installers and other scripts should never remove
anything from the user's PATH (and much less his whole profile!). It
should always be enough to prepend the new preferred path to PATH, and
otherwise leave the PATH alone. In principle the scripter has no way to
know what programs the user has in his PATH, so the correct behaviour is to
leave it intact so that the user can still execute whatever custom programs
he has in his PATH, whereas of course precisely the programs for which a
new version is provided in the newly prepended path will have priority over
his old stuff...
Finally, as I already wrote recently, I find it very untrustworthy in
general to write rm scripts in AppleScripts. Even more so because one
cannot open and read the script to see what it does!
Let me just finish by saying that in spite of my disapproval of some of
your techniques, I do appreciate your efforts with these difficult issues
-- it is great you actually work out some possibilities, rather than just
grieving over Gerben's announcement. In a sense you are driving the
developments right now, with your energetic and important experiments!
They provoke Dick and Co. to come up with something quickly!
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
More information about the MacOSX-TeX