OSDN Git Service

Installation commamnds: v2.3.29p0213
authorTakuo Yasunaga <yasunaga@bio.kyutech.ac.jp>
Tue, 17 Nov 2015 23:08:11 +0000 (08:08 +0900)
committerTakuo Yasunaga <yasunaga@bio.kyutech.ac.jp>
Tue, 17 Nov 2015 23:08:11 +0000 (08:08 +0900)
modified:   env/Eos_env
modified:   env/install-eos.sh

env/Eos_env
env/install-eos.sh

index a1cf074..4838253 100755 (executable)
@@ -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
index da4b446..1d78afa 100755 (executable)
@@ -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