fix typo
[build.git] / module-tools.py
index 7aea7ac..940e4b5 100755 (executable)
@@ -12,7 +12,15 @@ from optparse import OptionParser
 # a map of name changes applied in git repositories.
 RENAMED_SVN_MODULES = {
     "PLEWWW": "plewww",
-    "PLCAPI": "plcapi"
+    "PLCAPI": "plcapi",
+    "BootManager": "bootmanager",
+    "BootCD": "bootcd",
+    "VserverReference": "vserver-reference",
+    "BootstrapFS": "bootstrapfs",
+    "MyPLC": "myplc",
+    "CoDemux": "codemux",
+    "NodeManager": "nodemanager",
+    "NodeUpdate": "nodeupdate"
     }
 
 def svn_to_git_name(module):
@@ -291,6 +299,10 @@ class GitRepository:
             return self.__run_in_repo(c.run_fatal)
 
     def update(self, subdir=None, recursive=None, branch="master"):
+        if branch == "master":
+            self.__run_command_in_repo("git checkout %s" % branch)
+        else:
+            self.__run_command_in_repo("git checkout origin/%s" % branch)
         self.__run_command_in_repo("git fetch origin --tags")
         self.__run_command_in_repo("git fetch origin")
         self.__run_command_in_repo("git merge --ff origin/%s" % branch)
@@ -355,7 +367,7 @@ class Repository:
 
     @classmethod
     def has_moved_to_git(cls, module, config):
-        module = git_to_svn_name(module)
+        module = svn_to_git_name(module)
         # check if the module is already in Git
 #        return SvnRepository.remote_exists("%s/%s/aaaa-has-moved-to-git" % (config['svnpath'], module))
         return GitRepository.remote_exists(Module.git_remote_dir(module))
@@ -624,6 +636,8 @@ that for other purposes than tagging""" % options.workdir
             self.repository.update(branch=self.branch)
         elif hasattr(self,'tagname'):
             self.repository.update(branch=self.tagname)
+        else:
+            self.repository.update()
 
     def main_specname (self):
         attempt="%s/%s.spec"%(self.module_dir,self.name)