OSDN Git Service

Modify: Bug fixed: git-clone(-XXXX)
authorkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Tue, 20 Jan 2015 08:34:36 +0000 (17:34 +0900)
committerkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Tue, 20 Jan 2015 08:34:36 +0000 (17:34 +0900)
modified:   Makefile

Makefile

index 2c6e47c..1be4d02 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -267,50 +267,25 @@ 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 | 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 ;
+       SSS=`git remote -v | awk '{print $$1}' | grep origin`; if [ ! -z "$$SSS" ] ; then git remote rm origin ; fi ;
 
 git-init-data::
        if [ ! -d data ] ; then mkdir 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 ;
+       cd data; SSS=`git remote -v | awk '{print $$1}' | grep data`; if [ ! -z "$$SSS" ] ; then git remote rm 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 | 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 ;
+       cd optional; SSS=`git remote -v | awk '{print $$1}' | grep optional`; if [ ! -z "$$SSS" ] ; then git remote rm optional ; fi ;
 
 git-init-tutorial::
        if [ ! -d tutorial ] ; then mkdir 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 ;
+       cd tutorial; SSS=`git remote -v | awk '{print $$1}' | grep tutorial`; if [ ! -z "$$SSS" ] ; then git remote rm tutorial ; fi ;
 
 git-init-others::
        if [ ! -d others ] ; then mkdir 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 ;
+       cd others ; SSS=`git remote -v | awk '{print $$1}' | grep others`; if [ ! -z "$$SSS" ] ; then git remote rm others ; fi ;
 
 git-init-others2::
        if [ ! -d others2 ] ; then mkdir others2; fi
@@ -323,8 +298,10 @@ 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
 
@@ -333,8 +310,10 @@ 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
 
@@ -343,8 +322,10 @@ 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
 
@@ -353,8 +334,10 @@ 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
 
@@ -363,8 +346,10 @@ 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