###### Users may need to modify the below line.
# Set Eos Home Directory
if [ -z "$EOS_HOME0" ] ; then
- export EOS_HOME=$HOME/Eos
- export EOS_MIRROR_SITE=$HOME/EosMirror
+ if [ -z "$EOS_HOME" ] ; then
+ export EOS_HOME=$HOME/Eos
+ export EOS_MIRROR_SITE=$HOME/EosMirror
+ else
+ export EOS_HOME=$EOS_HOME
+ export EOS_MIRROR_SITE=$EOS_MIRROR_SITE
+ fi
else
# For Personal(by install-eos.sh)
export EOS_HOME=$EOS_HOME0
#
# EOS_HOME0
#
- echo "Set the directroy to be installed [$EOS_HOME0]: "; read ANS
+ echo -n "Set the directroy to be installed [$EOS_HOME0]: "; read ANS
if [ ! -z $ANS ] ; then
EOS_HOME0=$ANS;
fi
#
# EOS_GITUSER0
#
- echo "Do you have your git account for OSDN [Y|y or N|n] ?"; read ANS
+ echo -n "Do you have your git account for OSDN [Y|y or N|n] ?"; read ANS
case $ANS in
N|n)
export EOS_GITUSER0=
;;
Y|y)
unset ANS
- echo "Set the git account for OSDN [$EOS_GITUSER0]: "; read ANS
+ echo -n "Set the git account for OSDN [$EOS_GITUSER0]: "; read ANS
if [ ! -z $ANS ] ; then
export EOS_GITUSER0=$ANS
fi
echo "GIT Account: $EOS_GITUSER0"
fi
unset ANS
- echo "Are these parameters OK [Y|y or N|n]? "; read ANS
+ echo -n "Are these parameters OK [Y|y or N|n]? "; read ANS
case $ANS in
Y|y)
;;
esac
+unset FLAG_BASHPROFILE
+echo -n "Do you want to rewrite $HOME/.bash_prfile ? [Y|y or N|n] " ; read FLAG_BASHPROFILE
+
+
#### No Change
#ROOT_EOS_SOURCEFORGE=https://sourceforge.jp/projects/eos/scm/git/base/blobs/master/
ROOT_EOS_OSDN_GIT=git://git.osdn.jp/gitroot/eos/base.git
if [ -d $EOS_HOME0/.git ] ; then
echo "Already installed"
echo "Use update-eos.sh for updating or set a new directory for installation"
+ exit 1
else
if [ -z $EOS_GITUSER0 ] ; then
INSTALL_FLAG=
git clone --depth 1 $ROOT_EOS_OSDN_GIT $EOS_HOME0 || \
git clone --depth 1 $ROOT_EOS_OSDN_HTTP $EOS_HOME0 || \
echo "A port for git (9418) or HTTP is not open, or something wrong."
+ INSTALL_FLAG="GITUSER"
fi
fi
-unset ANS
-echo "Do you want to rewrite $HOME/.bashr_prfile ? [Y|y or N|n] " ; read ANS
-
-case $ANS in
- Y|y)
- awk 'BEGIN {EOS="no"} {if($0=="## Eos_env Start") EOS="yes"; if(EOS!="yes") print $0;if($0=="## Eos_env End") EOS="no"; }' $HOME/.bash_profile > $HOME/.bash_profile.org
-
- cat $HOME/.bash_profile.org > $HOME/.bash_profile
- cat >> $HOME/.bash_profile << EOF
-## Eos_env Start
-##
-
-if [ ! -z $EOS_HOME0 ] ; then
- if [ -f $EOS_HOME0/env/Eos_env -a ! -f $HOME/.Eos_env ] ; then
- ln -s $EOS_HOME0/env/Eos_env $HOME/.Eos_env
- fi
-fi
-
-export EOS_HOME=$EOS_HOME0
-export EOS_GITUSER0=$EOS_GITUSER0
-
-test -r $HOME/.Eos_env && . $HOME/.Eos_env
-
-##
-## Eos_env End
-EOF
- ;;
-
- *)
- echo "Before you use Eos, "
- echo 'source $EOS_HOME0/env/Eos_env'
- echo " or "
- echo "You should rewrite $HOME/.bash_profile by yourself."
- ;;
-esac
-
#
# hostdepend
#
echo "Cannot make hostdepend"
fi
+
+#
+# .bash_profile
+#
+echo "Setting an environment for Eos"
+
+case $FLAG_BASHPROFILE in
+ Y|y)
+ awk 'BEGIN {EOS="no"} {if($0=="## Eos_env Start") EOS="yes"; if(EOS!="yes") print $0;if($0=="## Eos_env End") EOS="no"; }' $HOME/.bash_profile > $HOME/.bash_profile.org
+
+ cat $HOME/.bash_profile.org > $HOME/.bash_profile
+ cat >> $HOME/.bash_profile << EOF
+## Eos_env Start
+##
+
+if [ ! -z $EOS_HOME0 ] ; then
+ if [ -f $EOS_HOME0/env/Eos_env -a ! -f $HOME/.Eos_env ] ; then
+ ln -s $EOS_HOME0/env/Eos_env $HOME/.Eos_env
+ fi
+fi
+
+export EOS_HOME0=$EOS_HOME0
+export EOS_GITUSER0=$EOS_GITUSER0
+
+test -r $HOME/.Eos_env && . $HOME/.Eos_env
+
+##
+## Eos_env End
+EOF
+ echo "Please check $HOME/.bash_profile."
+ ;;
+
+ *)
+ echo "Before you use Eos, "
+ echo 'source $EOS_HOME0/env/Eos_env'
+ echo " or "
+ echo "You should rewrite $HOME/.bash_profile by yourself to execute $EOS_HOME0/env/Eos_env."
+ ;;
+esac
+
+#
+#
+#
+echo "You finished Eos installation."
+
cd $WD