From 391bd39d1d382c7b6482742fd4fa462017e81645 Mon Sep 17 00:00:00 2001 From: Takuo Yasunaga Date: Wed, 18 Nov 2015 08:08:11 +0900 Subject: [PATCH] Installation commamnds: modified: env/Eos_env modified: env/install-eos.sh --- env/Eos_env | 9 ++++-- env/install-eos.sh | 95 +++++++++++++++++++++++++++++++----------------------- 2 files changed, 62 insertions(+), 42 deletions(-) diff --git a/env/Eos_env b/env/Eos_env index a1cf0740cf..4838253b5e 100755 --- a/env/Eos_env +++ b/env/Eos_env @@ -3,8 +3,13 @@ ###### 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 diff --git a/env/install-eos.sh b/env/install-eos.sh index da4b446115..1d78afa642 100755 --- a/env/install-eos.sh +++ b/env/install-eos.sh @@ -39,7 +39,7 @@ function setEosHome0() { # # 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 @@ -52,14 +52,14 @@ function setEosGitUser0() { # # 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 @@ -80,7 +80,7 @@ function surelyHome0andGitUser0() { 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) @@ -111,6 +111,10 @@ case $# in ;; 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 @@ -128,6 +132,7 @@ fi 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= @@ -141,45 +146,10 @@ else 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 # @@ -234,4 +204,49 @@ else 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 -- 2.11.0