Skip to content

Commit

Permalink
libcmds: Factor checkout out of FinishSetupRepos
Browse files Browse the repository at this point in the history
This allows for easier to remember '--skip repos_checkout' when running
kas with locally committed changes on configured repos. Re-animate the
formerly unused ReposCheckout command for that and move it down in the
file for a better reading context.

Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
jan-kiszka committed Aug 31, 2023
1 parent 74cc43b commit 595d949
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions kas/libcmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def __init__(self, use_common_setup=True, use_common_cleanup=True):
InitSetupRepos(),
repo_loop,
FinishSetupRepos(),
ReposCheckout(),
ReposApplyPatches(),
SetupEnviron(),
WriteBBConfig(),
Expand Down Expand Up @@ -316,19 +317,6 @@ def execute(self, ctx):
repos_apply_patches(ctx.config.get_repos())


class ReposCheckout(Command):
"""
Ensures that the right revision of each repo is checked out.
"""

def __str__(self):
return 'repos_checkout'

def execute(self, ctx):
for repo in ctx.config.get_repos():
repo.checkout()


class InitSetupRepos(Command):
"""
Prepares setting up repos including the include logic
Expand Down Expand Up @@ -395,11 +383,21 @@ def __str__(self):
return 'finish_setup_repos'

def execute(self, ctx):
# now fetch everything with complete config and check out layers
# now fetch everything with complete config
repos_fetch(ctx.config.get_repos())

for repo in ctx.config.get_repos():
repo.checkout()

logging.debug('Configuration from config file:\n%s',
pprint.pformat(ctx.config.get_config()))


class ReposCheckout(Command):
"""
Ensures that the right revision of each repo is checked out.
"""

def __str__(self):
return 'repos_checkout'

def execute(self, ctx):
for repo in ctx.config.get_repos():
repo.checkout()

0 comments on commit 595d949

Please sign in to comment.