macros: Use new macro loop for repo setup

Divide the SetupRepos command into three parts: init, step and finish
Build a macro-based loop with the step part of the function.

Rewrite this in build.py and shell.py

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
This commit is contained in:
Andreas Reichel
2018-09-05 11:13:01 +02:00
committed by Daniel Wagner
parent fc9ebf1104
commit 6349f7ab73
3 changed files with 71 additions and 29 deletions

View File

@@ -31,7 +31,9 @@ from .context import create_global_context
from .config import Config
from .libcmds import (Macro, Command, SetupDir, SetupEnviron,
WriteBBConfig, SetupHome, ReposApplyPatches,
CleanupSSHAgent, SetupSSHAgent, SetupRepos)
CleanupSSHAgent, SetupSSHAgent,
Loop, InitSetupRepos, FinishSetupRepos,
SetupReposStep)
__license__ = 'MIT'
__copyright__ = 'Copyright (c) Siemens AG, 2017'
@@ -89,7 +91,14 @@ class Shell:
macro.add(SetupSSHAgent())
ctx.keep_config = args.keep_config_unchanged
macro.add(SetupRepos())
macro.add(InitSetupRepos())
repo_loop = Loop('repo_setup_loop')
repo_loop.add(SetupReposStep())
macro.add(repo_loop)
macro.add(FinishSetupRepos())
macro.add(SetupEnviron())
macro.add(SetupHome())