[Pythonmac-SIG] messed up Tiger python install

Jack Nutting jnutting at gmail.com
Mon Sep 12 15:57:18 CEST 2005


On 9/12/05, Bob Ippolito <bob at redivi.com> wrote:

> Patches accepted at http://sourceforge.net/projects/python :)


I don't know where the packagemaker configuration file is, but here's a step 
toward something that would work in postflight:

#!/bin/sh

dialogText="Version 2.4.1 of python has now been installed in 
/usr/local/bin. You probably want to use this new version as the default 
python, so that other python-using programs will find it instead of the 
built-in version. I can take care of this by putting /usr/local/bin/ at the 
front of your shell path. Should I do this for you?"
osascriptOutput=`/usr/bin/mktemp /tmp/osascript_XXXXXXXXX`
osascript >$osascriptOutput <<appleScriptEnd
on display_message_dialog()
try
tell application "Finder" to display dialog "$dialogText"
on error errMsg number errnum
if errnum is -128 then --If user canceled
return 0
else
error errMsg
end if
end try
return 1
end display_message_dialog

tell application "Finder" to activate
set dialogResult to display_message_dialog()
tell application "Terminal" to activate

return dialogResult
appleScriptEnd

shouldInsertIntoPath=`cat $osascriptOutput`
if [ $shouldInsertIntoPath = 1 ]; then
# user hit OK, now mangle their startup scripts
echo got yes!
fi

(obviously I left out the part where we actually modify the user's .profile, 
.bash_profile, .cshrc, and/or .tcshrc, but I thought that this bit of 
applescript hackery could help someone along the way)

-- 
// jack
// http://www.nuthole.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050912/efe0f3ed/attachment.htm


More information about the Pythonmac-SIG mailing list