This seems to happen with a fairly high degree of frequency and is a typical question asked on the Apple unix bb. I've answered it at least
On the fink list it has come up perhaps 5 times since pathsetup.command was introduced. This is a reduction by a factor of approximately 100 in the number of messages complaining about the setup of startup scripts.
The problem is that nobody seems to be able to explain exactly what manipulation these people have been doing in order to get there. I haven't seen anyone reproduce it. I suspect it happens only when you never opened a Terminal.app window before and then use the open window (instead of closing it as it says clearly) to set the preferences and finally click on "Use as default". But I haven't been able to reproduce even this.
As soon as anyone explains the reason for this bug, I am happy to try to fix it.
10 times. I wonder if there might be a better way to have the installer do this? An applescript (or osascript) "do shellscript" command would eliminate the need for having to open up a terminal window, and presumably would then eliminate the possibility for the terminal preference file getting corrupted. If the output really does need to be read, it could be piped into a log file and that file then opened in the Console application to display its contents (open foo.log opens a log
file and lets it scroll dynamically like a tail -999cf foo.log command).
The problem is not the output but the input. The script asks the user's permission to insert anything in the startup scripts. If we skip this precaution (which IMHO corresponds to Fink's non-intrusion policy that distinguishes Fink favorably from other package managers like iInstaller that clobber system config files without asking), then the whole script can run invisibly.
You are perfectly welcome to write a better version of this thing. It was originally meant to be a quick fix for an urgent problem (huge numbers of messages by new users after every new Fink release claiming that the instructions to manually insert the source /sw/bin/init.[c]sh into their startup scripts were not working).
It took me quite some time to get it working correctly, and I was not able to make it work inside an AppleScript. It is quite tricky to run a real login with the user's default shell and look whether the
paths are already set up. The script has to make sure that this login uses the same startup scripts that a real login would use. In addition, it cannot know in advance whether the user's shell is of the sh or csh language group, so it has to use language that is understood by both, which restricts the vocabulary to a very basic level.
Using a *.command script which opens a Terminal.app window was the only way I managed to do this. This does not mean, of course, that there aren't other better ways. Unfortunately, *.command scripts don't seem to permit to close the window at the end automatically.
Also, while I am at it, wouldn't it be better to have the lines dumped into the startup file look something like the following?
if [[ -f /sw/bin/init.sh ]]; then
. /sw/bin/init.sh
else
echo " WARNING!! Fink does not appear to be present and has not been initialized."
fi
That way if the user (re)moves /sw their startup script won't fail.
I haven't seen many complaints about this. If you remove /sw, you want to remove those lines from the startup scripts, anyway, I would say. But maybe such a warning might be a good idea. It could even tell which script it is residing in, so that the poor guy fed up with Fink doesn't have to hunt around for it.
-- Martin
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Fink-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/fink-users
