Update of /cvsroot/fink/experimental/costabel
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31034
Modified Files:
pathsetup.sh
Log Message:
CLI version, no Finder needed
Index: pathsetup.sh
===================================================================
RCS file: /cvsroot/fink/experimental/costabel/pathsetup.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pathsetup.sh 13 Mar 2004 23:24:31 -0000 1.1
+++ pathsetup.sh 21 Jul 2004 10:55:27 -0000 1.2
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# Shell script for preparing the user's shell startup scripts for Fink.
+# Shell script for preparing the user's shell startup scripts for Fink. CLI version.
# Copyright (c) 2003-2004 Martin Costabel
# Copyright (c) 2003-2004 The Fink Package Manager Team
#
@@ -59,63 +59,57 @@
echo I will create a file named $RC in your
echo home directory, containing one line
echo
- echo \\\"$SOURCECMD\\\"
+ echo " \"$SOURCECMD\""
}
msg_append () {
echo I will append a line
echo
- echo \\\"$SOURCECMD\\\"
+ echo " \"$SOURCECMD\""
echo
echo to the file $RC in your home directory.
}
msg_choose (){
echo If you do not want me to do this,
- echo you can answer \\\"No\\\" here
- echo and do it later manually.
- echo
- echo Continue\?
+ echo "you can answer \"No\" here and do it later manually."
echo
+ echo -n Continue\?
}
display_choose () {
-# display choice popup
- osascript <<-EOF
- tell application "Finder"
- activate
- set dd to display dialog "`msg_title`\nYour login shell: $LOGINSHELL\n\n`$MSG`
\n\n`msg_choose`\n" buttons {"No, thanks", "YES"} default button 2 with icon caution
giving up after 30
- set UserResponse to button returned of dd
- end tell
-EOF
+# display choice dialog
+ msg_title; echo "Your login shell: $LOGINSHELL"; echo ""
+ $MSG; echo ""
+ msg_choose
+ echo -n " [Y/n] "
+ read answer
+ answer=`echo $answer | sed 's/^[yY].*$/y/'`
+ if [ ! -z "$answer" -a "x$answer" != "xy" ]; then
+ answer="No, thanks"
+ fi
}
display_result (){
# display final result
- osascript <<-EOF
- tell application "Finder"
- activate
- set dd to display dialog "`msg_title`\n$Result\n" buttons {"OK"} default button
1 with icon caution giving up after 20
- set UserResponse to button returned of dd
- end tell
-EOF
+ printf "$Result"
}
display_choose_do (){
# propose choice, append line to startup script, and verify if it worked
- answer=`display_choose`
+ display_choose
if [ "$answer" != "No, thanks" ]; then
echo "" >> $HOME/$RC
echo "$SOURCECMD" >> $HOME/$RC
do_login_test
if grep /sw/sbin $TMPFILE >/dev/null 2>&1 ; then
- Result="\n Your Fink environment\n should be fine now.\n"
+ Result="\n Your Fink environment should be fine now.\n\n"
else
Result="\n
Hmm. I tried my best, but it still does not work.
The code I put into $RC has no effect.\n
Please check your $LOGINSHELL startup scripts.
-Perhaps some other file like\n
+Perhaps some other file like\n
~/.login\n
is resetting the PATH after $RC is executed.
\n"
@@ -132,13 +126,7 @@
}
display_already_setup (){
- osascript <<-EOF
- tell application "Finder"
- activate
- set dd to display dialog "`msg_title`\n\n`msg_already_setup`" buttons {"OK"}
default button 1 giving up after 20
- set UserResponse to button returned of dd
- end tell
-EOF
+ msg_title; echo""; msg_already_setup
}
# End of function declarations
@@ -167,7 +155,7 @@
case $LOGINSHELL in
*csh)
# For csh and tcsh
- SOURCECMD="source /sw/bin/init.csh"
+ SOURCECMD="test -r /sw/bin/init.csh && source /sw/bin/init.csh"
if [ -f $HOME/.tcshrc ]; then
RC=.tcshrc
elif [ -f $HOME/.cshrc ]; then
@@ -188,7 +176,7 @@
;;
bash)
# Only bash here; other sh type shells are not supported
- SOURCECMD=". /sw/bin/init.sh"
+ SOURCECMD="test -r /sw/bin/init.sh && . /sw/bin/init.sh"
if [ -f $HOME/.bash_profile ]; then
RC=.bash_profile
elif [ -f $HOME/.bash_login ]; then
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits