Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-29 22:14:39 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-29 22:14:39 (GMT)
commit48c02f188784d65bd501a907e572e041ed61dc15 (patch)
treeee0cccdeb5047c6e2262ba9b15fa87e1c2dcc35e /devbot
parent7df65ab65c28983f1792e1ac5f8326842b87ba2d (diff)
Use the new git module in build
Diffstat (limited to 'devbot')
-rw-r--r--devbot/build.py33
-rw-r--r--devbot/config.py1
2 files changed, 5 insertions, 29 deletions
diff --git a/devbot/build.py b/devbot/build.py
index 9c616aa..e958078 100644
--- a/devbot/build.py
+++ b/devbot/build.py
@@ -8,6 +8,7 @@ import time
from devbot import command
from devbot import config
from devbot import environ
+from devbot import git
from devbot import state
from devbot import utils
@@ -86,39 +87,13 @@ def _unlink_libtool_files():
os.path.walk(config.lib_dir, func, None)
-def _is_detached_head():
- return subprocess.call(["git", "symbolic-ref", "-q", "HEAD"],
- stdout=utils.devnull,
- stderr=subprocess.STDOUT) != 0
-
-def _pull_git_module(module):
- module_dir = module.get_source_dir()
-
- if os.path.exists(os.path.join(module_dir, ".git")):
- os.chdir(module_dir)
-
- command.run(["git", "remote", "set-url", "origin", module.repo])
-
- if _is_detached_head():
- command.run(["git", "remote", "update", "origin"], retry=10)
- command.run(["git", "checkout", module.branch])
- else:
- command.run(["git", "checkout", module.branch])
- command.run(["git", "pull"], retry=10)
- else:
- os.chdir(config.get_source_dir())
-
- command.run(["git", "clone", "--progress", module.repo, module.name],
- retry=10)
-
- os.chdir(module_dir)
- command.run(["git", "checkout", module.branch])
-
def _pull_module(module):
print "\n=== Pulling %s ===\n" % module.name
try:
- _pull_git_module(module)
+ git_module = git.Module(config.get_source_dir(), module.name,
+ module.repo, module.tag)
+ git_module.update()
except subprocess.CalledProcessError:
return False
diff --git a/devbot/config.py b/devbot/config.py
index 513fe10..0f76644 100644
--- a/devbot/config.py
+++ b/devbot/config.py
@@ -33,6 +33,7 @@ class Module:
self.name = info["name"]
self.repo = info["repo"]
self.branch = info.get("branch", "master")
+ self.tag = info.get("tag", None)
self.auto_install = info.get("auto-install", False)
self.options = info.get("options", [])