OSDN Git Service

For updating v2.3.25p0197
authorTakuo Yasunaga <yasunaga@bio.kyutech.ac.jp>
Thu, 5 Nov 2015 18:23:55 +0000 (03:23 +0900)
committerTakuo Yasunaga <yasunaga@bio.kyutech.ac.jp>
Thu, 5 Nov 2015 18:23:55 +0000 (03:23 +0900)
modified:   env/install-eos.sh
new file:   env/update-eos.sh

env/install-eos.sh
env/update-eos.sh [new file with mode: 0755]

index 6011d84..2b1b0a5 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 #### 
+WD=`pwd`
+
 
 if [ -z $EOS_HOME0 ] ; then
        EOS_HOME0=$HOME/Eos
@@ -39,7 +41,7 @@ else
                echo "A port for SSH or HTTPS is not open, or something wrong for $EOS_GITUSER."
                INSTALL_FLAG=INSTALL
        fi
-       if [ -z $NOT_INSTALL ] ; then
+       if [ -z $INSTALL_FLAG ] ; then
                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."
@@ -89,7 +91,7 @@ fi
 
 if [ -d $EOS_HOME0/hostdepend ] ; then
        cd $EOS_HOME0/hostdepend/;  
-       if [ -d ${EOS_HOSTDIR}/.git ] ; 
+       if [ -d ${EOS_HOSTDIR}/.git ] ; then
                echo "Already installed hostdepend/${EOS_HOSTDIR}"; 
                echo "Use update-eos.sh for updating or set a new directory for installation"
        else 
@@ -101,7 +103,7 @@ if [ -d $EOS_HOME0/hostdepend ] ; then
                        echo "A port for SSH or HTTPS is not open, or something wrong."
                        INSTALL_FLAG=INSTALL
                fi
-               if [ -z $NOT_INSTALL ] ; then
+               if [ -z $INSTALL_FLAG ] ; then
                        git clone --depth 1 ${HOSTDEPEND_EOS_OSDN_GIT} ${EOS_HOSTDIR} || \
                        git clone --depth 1 ${HOSTDEPEND_EOS_OSDN_HTTP} ${EOS_HOSTDIR} || \
                        echo "A port for git (9418) or HTTP is not open, or something wrong."
@@ -110,3 +112,5 @@ if [ -d $EOS_HOME0/hostdepend ] ; then
 else
        echo "Cannot make hostdepend"
 fi
+
+cd $WD
diff --git a/env/update-eos.sh b/env/update-eos.sh
new file mode 100755 (executable)
index 0000000..2a6febf
--- /dev/null
@@ -0,0 +1,72 @@
+#!/bin/sh
+WD=`pwd`
+
+if [ -z $EOS_HOME ] ; then
+       echo "Please set an environment for Eos using $source env/Eos_env."
+       exit
+fi
+
+ROOT_EOS_OSDN_GIT=git://git.osdn.jp/gitroot/eos/base.git
+ROOT_EOS_OSDN_HTTP=http://scm.osdn.jp/gitroot/eos/base.git
+ROOT_EOS_OSDN_SSH=${EOS_GITUSER}@git.osdn.jp:/gitroot/eos/base.git
+ROOT_EOS_OSDN_HTTPS=https://scm.osdn.jp/gitroot/eos/base.git
+
+if [ ! -d $EOS_HOME/.git ] ; then
+       echo "Not installed"
+       echo "Use install-eos.sh for updating or make concern env of EOS_HOME. Current var is $EOS_HOME."
+else
+       if [ -z $EOS_GITUSER ] ; then
+               INSTALL_FLAG=
+       else
+               cd $EOS_HOME; echo "$EOS_GITUSER as EOS_GITUSER";  
+               git pull $ROOT_EOS_OSDN_SSH || \
+               git pull --depth 1 $ROOT_EOS_OSDN_HTTPS || \
+                       echo "A port for SSH or HTTPS is not open, or something wrong for $EOS_GITUSER."
+                       INSTALL_FLAG=INSTALL
+       fi
+       if [ -z $NOT_INSTALL ] ; then
+               cd $EOS_HOME; echo "No EOS_GITUSER."; 
+               git pull $ROOT_EOS_OSDN_GIT  || \
+               git pull $ROOT_EOS_OSDN_HTTP || \
+               echo "A port for git (9418) or HTTP is not open, or something wrong."
+       fi
+fi
+
+if [ -z ${EOS_HOSTDIR} ] ; then
+       echo "Set EOS_HOSTDIR. Current is $EOS_HOSTDIR";
+       exit;
+else
+       echo "hostdepend for ${EOS_HOSTDIR}"
+fi
+
+HOSTDEPEND_EOS_OSDN_GIT=git://git.osdn.jp/gitroot/eos/hostdepend${EOS_HOSTDIR}.git
+HOSTDEPEND_EOS_OSDN_HTTP=http://scm.osdn.jp/gitroot/eos/hostdepend${EOS_HOSTDIR}.git
+HOSTDEPEND_EOS_OSDN_SSH=${EOS_GITUSER}@git.osdn.jp:/gitroot/eos/hostdepend${EOS_HOSTDIR}.git
+HOSTDEPEND_EOS_OSDN_HTTPS=https://scm.osdn.jp/gitroot/eos/hostdepend${EOS_HOSTDIR}.git
+
+if [ -d $EOS_HOME/hostdepend ] ; then
+    cd $EOS_HOME/hostdepend/;  
+    if [ ! -d ${EOS_HOSTDIR}/.git ] ; then
+        echo "Not installed hostdepend/${EOS_HOSTDIR}"; 
+        echo "Use install-eos.sh for updating or set a new directory for update"
+    else 
+        if [ -z $EOS_GITUSER ] ; then
+            INSTALL_FLAG=
+        else 
+                       cd ${EOS_HOSTDIR}
+            git pull ${HOSTDEPEND_EOS_OSDN_SSH}   || \
+            git pull ${HOSTDEPEND_EOS_OSDN_HTTPS} || \
+            echo "A port for SSH or HTTPS is not open, or something wrong."
+            INSTALL_FLAG=INSTALL
+        fi  
+        if [ -z $NOT_INSTALL ] ; then
+            git pull ${HOSTDEPEND_EOS_OSDN_GIT}  || \
+            git pull ${HOSTDEPEND_EOS_OSDN_HTTP} || \
+            echo "A port for git (9418) or HTTP is not open, or something wrong."
+        fi  
+    fi  
+else
+    echo "No hostdepend dir"
+fi
+
+cd $WD