OSDN Git Service

Revert "Modify: Bug fixed: git-clone(-XXXX)"
authorkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Tue, 20 Jan 2015 09:34:08 +0000 (18:34 +0900)
committerkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Tue, 20 Jan 2015 09:34:08 +0000 (18:34 +0900)
This reverts commit b4f6094c7225a1a9724d3dfa7c0c867612803786.

Modify: Revert Makefile for git-clone.
modified:   Makefile

Makefile

index 1be4d02..2c6e47c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -267,25 +267,50 @@ git-init-all:: git-init git-init-data git-init-optional git-init-tutorial git-in
 
 git-init::
        if [ ! -d .git ] ; then git init        ; fi
-       SSS=`git remote -v | awk '{print $$1}' | grep origin`; if [ ! -z "$$SSS" ] ; then git remote rm origin ; fi ;
+       SSS=`git remote -v | grep origin`; if [ ! -z "$$SSS" ] ; then git remote rm origin ; fi ; \
+       if [ -z $${EOS_GITUSER} ] ; then \
+               git remote add origin    $(EOS_GIT_REPOSITRY_NOUSER); \
+       else \
+               git remote add origin    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY); \
+       fi ;
 
 git-init-data::
        if [ ! -d data ] ; then mkdir data; fi
-       cd data; SSS=`git remote -v | awk '{print $$1}' | grep data`; if [ ! -z "$$SSS" ] ; then git remote rm data ; fi ;
+       cd data; SSS=`git remote -v | grep data`; if [ ! -z "$$SSS" ] ; then git remote rm data ; fi ; \
+       if [ -z $${EOS_GITUSER} ] ; then \
+               git remote add data    $(EOS_GIT_REPOSITRY_DATA_NOUSER); \
+       else \
+               git remote add data    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_DATA); \
+       fi ;
 
 git-init-optional::
        if [ ! -d optional ] ; then mkdir optional; fi
        if [ ! -L doc      ] ; then ln -sf optional/doc . ; fi
        if [ ! -L objects  ] ; then ln -sf optional/objects . ; fi
-       cd optional; SSS=`git remote -v | awk '{print $$1}' | grep optional`; if [ ! -z "$$SSS" ] ; then git remote rm optional ; fi ;
+       cd optional; SSS=`git remote -v | grep optional`; if [ ! -z "$$SSS" ] ; then git remote rm optional ; fi ; \
+       if [ -z $${EOS_GITUSER} ] ; then \
+               git remote add optional    $(EOS_GIT_REPOSITRY_OPTIONAL_NOUSER); \
+       else \
+               git remote add optional    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OPTIONAL); \
+       fi ;
 
 git-init-tutorial::
        if [ ! -d tutorial ] ; then mkdir tutorial ; fi
-       cd tutorial; SSS=`git remote -v | awk '{print $$1}' | grep tutorial`; if [ ! -z "$$SSS" ] ; then git remote rm tutorial ; fi ;
+       cd tutorial; SSS=`git remote -v | grep tutorial`; if [ ! -z "$$SSS" ] ; then git remote rm tutorial ; fi ; \
+       if [ -z $${EOS_GITUSER} ] ; then \
+               git remote add tutorial    $(EOS_GIT_REPOSITRY_TUTORIAL_NOUSER); \
+       else \
+               git remote add tutorial    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_TUTORIAL); \
+       fi ;
 
 git-init-others::
        if [ ! -d others ] ; then mkdir others; fi
-       cd others ; SSS=`git remote -v | awk '{print $$1}' | grep others`; if [ ! -z "$$SSS" ] ; then git remote rm others ; fi ;
+       cd others ; SSS=`git remote -v | grep others`; if [ ! -z "$$SSS" ] ; then git remote rm others ; fi ; \
+       if [ -z $${EOS_GITUSER} ] ; then \
+               git remote add others    $(EOS_GIT_REPOSITRY_OTHERS_NOUSER); \
+       else \
+               git remote add others    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS); \
+       fi ;
 
 git-init-others2::
        if [ ! -d others2 ] ; then mkdir others2; fi
@@ -298,10 +323,8 @@ git-clone:git-init
        then \
                if [ -z $${EOS_GITUSER} ] ; then \
                        git clone --depth 1 $(EOS_GIT_REPOSITRY_NOUSER) ./ ; \
-                       git remote add origin    $(EOS_GIT_REPOSITRY_NOUSER); \
                else \
                        git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY) ./ ; \
-                       git remote add origin    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY); \
                fi ; \
        fi
 
@@ -310,10 +333,8 @@ git-clone-data: git-init-data
        then \
                if [ -z $${EOS_GITUSER} ] ; then \
                        git clone --depth 1 $(EOS_GIT_REPOSITRY_DATA_NOUSER) ./ ; \
-                       git remote add data    $(EOS_GIT_REPOSITRY_DATA_NOUSER); \
                else \
                        git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_DATA) ./; \
-                       git remote add data    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_DATA); \
                fi ; \
        fi
 
@@ -322,10 +343,8 @@ git-clone-optional: git-init-optional
        then \
                if [ -z $${EOS_GITUSER} ] ; then \
                        git clone --depth 1 $(EOS_GIT_REPOSITRY_OPTIONAL_NOUSER) ./ ; \
-                       git remote add optional    $(EOS_GIT_REPOSITRY_OPTIONAL_NOUSER); \
                else \
                        git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OPTIONAL) ./ ; \
-                       git remote add optional    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OPTIONAL); \
                fi ; \
        fi
 
@@ -334,10 +353,8 @@ git-clone-tutorial: git-init-tutorial
        then \
                if [ -z $${EOS_GITUSER} ] ; then \
                        git clone --depth 1 $(EOS_GIT_REPOSITRY_TUTORIAL_NOUSER) ./ ; \
-                       git remote add tutorial    $(EOS_GIT_REPOSITRY_TUTORIAL_NOUSER); \
                else \
                        git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_TUTORIAL) ./ ; \
-                       git remote add tutorial    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_TUTORIAL); \
                fi; \
        fi
 
@@ -346,10 +363,8 @@ git-clone-others: git-init-others
        then \
                if [ -z $${EOS_GITUSER} ] ; then \
                        git clone --depth 1 $(EOS_GIT_REPOSITRY_OTHERS_NOUSER) ./ ; \
-                       git remote add others    $(EOS_GIT_REPOSITRY_OTHERS_NOUSER); \
                else \
                        git clone --depth 1 $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS) ./ ; \
-                       git remote add others    $${EOS_GITUSER}@$(EOS_GIT_REPOSITRY_OTHERS); \
                fi; \
        fi