diff -Naur rox-base-1.0.2/install.sh rox-base-new/install.sh --- rox-base-1.0.2/install.sh 2001-10-08 10:41:14.000000000 -0400 +++ rox-base-new/install.sh 2002-04-10 09:28:12.000000000 -0400 @@ -13,16 +13,16 @@ fi } -confirm_or_die() { - while [ 1 -eq 1 ]; do - printf "[yes/no] >>> " - read CONFIRM - case $CONFIRM in - [yY]*) return;; - [nN]*) die "OK.";; - esac - done -} +#confirm_or_die() { +# while [ 1 -eq 1 ]; do +# printf "[yes/no] >>> " +# read CONFIRM +# case $CONFIRM in +# [yY]*) return;; +# [nN]*) die "OK.";; +# esac +# done +#} # Installs a file in Choices if it isn't there already. install_if_missing() { @@ -39,81 +39,85 @@ umask 022 +PREFIX="$1" +INSTALL_PREFIX="$2" -cat << EOF - - -These icons and defaults need to be installed where applications such -as ROX-Filer can find them. The directories searched are given by -the CHOICESPATH variable. In your case, the following would be checked: - -EOF - -if [ ! -n "$CHOICESPATH" ]; then - CHOICESPATH=${HOME}/Choices:/usr/local/share/Choices:/usr/share/Choices - echo "(CHOICESPATH unset - using default)" -fi -IFS=":" -WARN=" *** Warning : CHOICESPATH is set, but empty! ***\n" -MYCHOICES="" -for DIR in $CHOICESPATH; do - if [ -n "$DIR" ]; then - echo " $DIR" - WARN="" - if [ ! -n "$MYCHOICES" ]; then - MYCHOICES="$DIR" - fi - fi -done -printf "$WARN" -if [ ! -n "$MYCHOICES" ]; then - MYCHOICES="${HOME}/Choices" -fi - -cat << EOF - -in that order. You can choose a different search path by setting -the CHOICESPATH environment variable before running the program. - -Which Choices directory would you like to use? Option (1) is recommended -if you have root access; otherwise option (2) is best. - -1) /usr/local/share/Choices -2) ${MYCHOICES} -3) /usr/share/Choices - -Enter 1, 2, 3 or a path (starting with /): -EOF -printf ">>> " - -read REPLY -echo - -case $REPLY in - 1) CHOICES=/usr/local/share/Choices;; - 2) CHOICES=${MYCHOICES};; - 3) CHOICES=/usr/share/Choices;; - /*) CHOICES="$REPLY" - echo "*** NOTE that if you install into a non-standard Choices " - echo "*** directory then you must ensure that CHOICESPATH is set " - echo "*** correctly before running any programs!" - echo;; - *) die "Invalid choice!";; -esac - -echo "Default icons and run actions will be installed into '$CHOICES'." +#cat << EOF +# +# +#These icons and defaults need to be installed where applications such +#as ROX-Filer can find them. The directories searched are given by +#the CHOICESPATH variable. In your case, the following would be checked: +# +#EOF +# +#if [ ! -n "$CHOICESPATH" ]; then +# CHOICESPATH=${HOME}/Choices:/usr/local/share/Choices:/usr/share/Choices +# echo "(CHOICESPATH unset - using default)" +#fi +#IFS=":" +#WARN=" *** Warning : CHOICESPATH is set, but empty! ***\n" +#MYCHOICES="" +#for DIR in $CHOICESPATH; do +# if [ -n "$DIR" ]; then +# echo " $DIR" +# WARN="" +# if [ ! -n "$MYCHOICES" ]; then +# MYCHOICES="$DIR" +# fi +# fi +#done +#printf "$WARN" +#if [ ! -n "$MYCHOICES" ]; then +# MYCHOICES="${HOME}/Choices" +#fi +# +#cat << EOF +# +#in that order. You can choose a different search path by setting +#the CHOICESPATH environment variable before running the program. +# +#Which Choices directory would you like to use? Option (1) is recommended +#if you have root access; otherwise option (2) is best. +# +#1) /usr/local/share/Choices +#2) ${MYCHOICES} +#3) /usr/share/Choices +# +#Enter 1, 2, 3 or a path (starting with /): +#EOF +#printf ">>> " +# +#read REPLY +#echo +# +#case $REPLY in +# 1) CHOICES=/usr/local/share/Choices;; +# 2) CHOICES=${MYCHOICES};; +# 3) CHOICES=/usr/share/Choices;; +# /*) CHOICES="$REPLY" +# echo "*** NOTE that if you install into a non-standard Choices " +# echo "*** directory then you must ensure that CHOICESPATH is set " +# echo "*** correctly before running any programs!" +# echo;; +# *) die "Invalid choice!";; +#esac + +ROOTCHOICES="${PREFIX}/share/Choices/" +CHOICES="${INSTALL_PREFIX}/share/Choices" +echo "Default icons and run actions will be installed into '$ROOTCHOICES'." endir "$CHOICES" -if [ -d "$CHOICES/MIME-icons" ]; then - cat << EOF -WARNING: You already have a $CHOICES/MIME-icons -directory --- any icons you have modified will be overwritten! - -Continue? -EOF - confirm_or_die -fi +#if [ -d "$CHOICES/MIME-icons" ]; then +# cat << EOF +#WARNING: You already have a $CHOICES/MIME-icons +#directory --- any icons you have modified will be overwritten! +# +#Continue? +#EOF +# confirm_or_die +#fi endir "$CHOICES/MIME-icons" endir "$CHOICES/MIME-info" @@ -131,4 +135,31 @@ cp Choices/MIME-info/* "$CHOICES/MIME-info" echo -echo "OK, done. Now you can install and use ROX-Filer!" +### Modified for Fink +echo "Setting up CHOICESPATH environment variable..." +DEFAULTCHOICES="no" +if [ ! -n "${CHOICESPATH}" ]; then + CHOICESPATH="\${HOME}/Library/Choices:${ROOTCHOICES}" + DEFAULTCHOICES="yes" +fi +echo "Your CHOICESPATH is set to '${CHOICESPATH}'." +echo +if [ `echo "${CHOICESPATH}" | grep "${ROOTCHOICES}" | wc -c` == 0 ]; then + +cat << EOF +This path does not include the location your default choices have been +installed (${ROOTCHOICES}). +It is recommended that you set CHOICESPATH in your .cshrc or .profile to +include this location. + +EOF +fi + +PROFILE_DIR="${INSTALL_PREFIX}/etc/profile.d" +mkdir -p "${PROFILE_DIR}" +sed -e "s%@CHOICESPATH@%${CHOICESPATH}%g" rox-base.sh > "${PROFILE_DIR}/rox-base.sh" +sed -e "s%@CHOICESPATH@%${CHOICESPATH}%g" rox-base.csh > "${PROFILE_DIR}/rox-base.csh" +chmod 755 "${PROFILE_DIR}/rox-base.sh" +chmod 755 "${PROFILE_DIR}/rox-base.csh" + +echo "Done installing rox-base." diff -Naur rox-base-1.0.2/rox-base.csh rox-base-new/rox-base.csh --- rox-base-1.0.2/rox-base.csh 1969-12-31 19:00:00.000000000 -0500 +++ rox-base-new/rox-base.csh 2002-04-10 09:23:06.000000000 -0400 @@ -0,0 +1,7 @@ +if ( $?CHOICESPATH == 0 ) then + setenv CHOICESPATH "@CHOICESPATH@" + if ( `echo "${CHOICESPATH}" | grep "${HOME}/Library/Choices" | wc -c` != 0 && \ + ! -f "${HOME}/Library/Choices" ) then + mkdir -p "${HOME}/Library/Choices" + endif +endif diff -Naur rox-base-1.0.2/rox-base.sh rox-base-new/rox-base.sh --- rox-base-1.0.2/rox-base.sh 1969-12-31 19:00:00.000000000 -0500 +++ rox-base-new/rox-base.sh 2002-04-10 09:23:00.000000000 -0400 @@ -0,0 +1,7 @@ +if [ -z "${CHOICESPATH}" ]; then + export CHOICESPATH="@CHOICESPATH@" + if [ `echo "${CHOICESPATH}" | grep "${HOME}/Library/Choices" | wc -c` != 0 -a \ + ! -f "${HOME}/Library/Choices" ]; then + mkdir -p "${HOME}/Library/Choices" + fi +fi