[OS X TeX] Switcher

Claus Gerhardt gerhardt at math.uni-heidelberg.de
Mon Nov 27 12:11:39 EST 2006


Switcher always checks at start up, if /usr/local/texprograms exists  
*and* is a symlink. In the new ReadMe file I emphasized this.

I copy below the script for switching to tetex which could serve as a  
template. If I have more time I shall provide a download for the  
source files.

Claus

set displayError to "Your TeX source is not defined."
	try
		set texsource to "teTeX" as string
		
		set texbin to do shell script "/usr/bin/uname -p"
		set sourceName to "/usr/local/" & texsource & "/bin/" & texbin & "- 
apple-darwin-current"
		
		set theFile to POSIX file sourceName as string
		tell application "Finder"
			get displayed name of the folder theFile
		end tell
	on error
		display dialog displayError buttons {"Cancel"} default button "Cancel"
	end try
	
	
	try
		set theFile to POSIX file sourceName as string
		tell application "Finder"
			get displayed name of the folder theFile
		end tell
	on error
		display dialog displayError buttons {"Cancel"} default button "Cancel"
	end try
	set dirName to do shell script "dirname " & "~/ex"
	
	set symlinkName to "/usr/local/" & "texprograms"
	
	
	
	set scriptPath to "/usr/local/"
	
	set shellScript to "cd " & scriptPath & ";"
	set shellScript to shellScript & "rm -fR " & symlinkName & ";"
	set shellScript to shellScript & "ln -s  -f " & sourceName & " " &  
symlinkName
	
	do shell script shellScript with administrator privileges




On Nov 27, 2006, at 8:03, Gerben Wierda wrote:

> On Nov 26, 2006, at 23:02 , Claus Gerhardt wrote:
>
>> You did omit some important lines from my ReadMe file:
>
> Claus,
>
> if you want to help and support people (and you do by publishing  
> this, otherwise you cold just have used it yourself), you need to  
> make sure:
> - people can inspect what your programs and scripts do. So you need  
> to publish source as well, and  a readme is not enough
> - you should take the trouble to prevent destructive behaviour on  
> people's systems (if you reset /usr/local/texprograms and someone  
> has made that already for different reasons and it is a directory,  
> do you bluntly remove it?) as much as possible.
>
> There is much more, but I thought I'd give you at least these,
>
> G
>
> ------------------------- 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/
>

------------------------- 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 mailing list