mirror of
https://github.com/IEEE-SB-Passau/pelican-deployment-system.git
synced 2017-09-06 16:35:38 +02:00
Revert "rework submodule updating, they suck really!"
The manual submodule recursing most likely does not work any better
This reverts commit df8b8e915b.
This commit is contained in:
@@ -181,9 +181,11 @@ class DeploymentRunner:
|
|||||||
|
|
||||||
def _update_build_repo_submodules(self, repo):
|
def _update_build_repo_submodules(self, repo):
|
||||||
log.info("%s build_repo: update submodules", self.name)
|
log.info("%s build_repo: update submodules", self.name)
|
||||||
results = repo.submodule_sync_update_init_recursive_force()
|
# we must update the urls if changed!
|
||||||
for r in results:
|
result = repo.submodule("sync", "--recursive")
|
||||||
log_git(r)
|
log_git(result)
|
||||||
|
result = repo.submodule("update", "--init", "--force", "--recursive")
|
||||||
|
log_git(result)
|
||||||
|
|
||||||
def build(self, abort_running=False, wait=False, ignore_pull_error=False,
|
def build(self, abort_running=False, wait=False, ignore_pull_error=False,
|
||||||
build_fn=None):
|
build_fn=None):
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
import os
|
import os
|
||||||
import errno
|
import errno
|
||||||
import shlex
|
import shlex
|
||||||
from collections import namedtuple, deque
|
from collections import namedtuple
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
CmdResult = namedtuple("CmdResult", "cmd status stdout stderr")
|
CmdResult = namedtuple("CmdResult", "cmd status stdout stderr")
|
||||||
@@ -69,33 +69,6 @@ class Repo:
|
|||||||
res = self.config("--get", key)
|
res = self.config("--get", key)
|
||||||
return res.stdout.rstrip("\r\n")
|
return res.stdout.rstrip("\r\n")
|
||||||
|
|
||||||
def submodule_sync_update_init_recursive_force(self):
|
|
||||||
results = []
|
|
||||||
todo = deque()
|
|
||||||
todo.extend(self._get_submod_paths())
|
|
||||||
while todo:
|
|
||||||
curr = todo.popleft()
|
|
||||||
if not os.path.exists(os.path.join(self.repo_dir, curr)):
|
|
||||||
continue # that happens, strangely...
|
|
||||||
results.append(self.cmd(self.git_cmd, "-C", curr,
|
|
||||||
"submodule", "sync"))
|
|
||||||
results.append(self.cmd(self.git_cmd, "-C", curr,
|
|
||||||
"submodule", "update", "--init", "--force"))
|
|
||||||
todo.extend(os.path.join(curr, p) for p in
|
|
||||||
self._get_submod_paths(curr))
|
|
||||||
return results
|
|
||||||
|
|
||||||
def _get_submod_paths(self, submod="."):
|
|
||||||
if not os.path.exists(os.path.join(self.repo_dir, submod,
|
|
||||||
".gitmodules")):
|
|
||||||
return ()
|
|
||||||
|
|
||||||
result = self.cmd(self.git_cmd, "-C", submod, "config", "--file",
|
|
||||||
".gitmodules", "--get-regexp", "submodule\..*\.path")
|
|
||||||
return tuple(p.split(maxsplit=1)[1] for p in result.stdout.splitlines())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def log_git_result(result, out_logger=None, err_logger=None, status_logger=None):
|
def log_git_result(result, out_logger=None, err_logger=None, status_logger=None):
|
||||||
if status_logger:
|
if status_logger:
|
||||||
err_logger('%s exit status: %s', result.cmd, result.status)
|
err_logger('%s exit status: %s', result.cmd, result.status)
|
||||||
|
|||||||
Reference in New Issue
Block a user