From a99af98be8e6ef60f593f60aff0a9d97e5883784 Mon Sep 17 00:00:00 2001 From: Roxana Nicolescu Date: Thu, 21 May 2026 13:31:40 +0200 Subject: [PATCH 1/2] kt/data/kernels.yaml: Add kernel-src-tree-tools repo So that it will be cloned/updated during kt setup. Because users will probably have local unstaged changes, the current git pull --rebase will fail. The error is caught but kt setup will continue to clone/update the rest of the repos. Signed-off-by: Roxana Nicolescu --- kt/commands/setup/impl.py | 8 +++++++- kt/data/kernels.yaml | 1 + kt/ktlib/repo.py | 16 ++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/kt/commands/setup/impl.py b/kt/commands/setup/impl.py index d5cff67..e368d3b 100644 --- a/kt/commands/setup/impl.py +++ b/kt/commands/setup/impl.py @@ -1,5 +1,8 @@ +import logging + from kt.ktlib.config import Config from kt.ktlib.kernels import KernelsInfo +from kt.ktlib.repo import RepoInfoException def main(): @@ -10,4 +13,7 @@ def main(): repos = KernelsInfo.from_yaml(config=config).repos for repo in repos.values(): - repo.setup_repo() + try: + repo.setup_repo() + except RepoInfoException as e: + logging.error(e, exc_info=True) diff --git a/kt/data/kernels.yaml b/kt/data/kernels.yaml index ecc1b0a..b9d1a93 100644 --- a/kt/data/kernels.yaml +++ b/kt/data/kernels.yaml @@ -1,6 +1,7 @@ common_repos: dist-git-tree-fips: git@gitlab.com:ctrl-iq-public/fips/src/kernel.git kernel-src-tree: https://github.com/ctrliq/kernel-src-tree.git + kernel-src-tree-tools: https://github.com/ctrliq/kernel-src-tree-tools.git kernels: cbr-7.9: diff --git a/kt/ktlib/repo.py b/kt/ktlib/repo.py index 74e1c95..97bb0ea 100644 --- a/kt/ktlib/repo.py +++ b/kt/ktlib/repo.py @@ -6,6 +6,10 @@ from pathlib3x import Path +class RepoInfoException(Exception): + pass + + @dataclass class RepoInfo: """ @@ -36,9 +40,17 @@ def setup_repo(self): If destination already exists and override == True, nothing is done """ + if not self.folder.exists(): - self._clone_repo() + try: + self._clone_repo() + except git.GitCommandError as e: + raise RepoInfoException(f"{self.folder.name} could not be cloned") from e + return logging.info(f"{self.folder} already exists, updating it") - self._update() + try: + self._update() + except git.GitCommandError as e: + raise RepoInfoException(f"{self.folder.name} could not be updated") from e From e1be2c794d93de64c46e6edc785a8a8b18efa161 Mon Sep 17 00:00:00 2001 From: Roxana Nicolescu Date: Thu, 21 May 2026 15:48:52 +0200 Subject: [PATCH 2/2] kt/ktlib/repo.py: Update obsolete docstring in setup_repo There is no override parameter. Signed-off-by: Roxana Nicolescu --- kt/ktlib/repo.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kt/ktlib/repo.py b/kt/ktlib/repo.py index 97bb0ea..435c818 100644 --- a/kt/ktlib/repo.py +++ b/kt/ktlib/repo.py @@ -37,8 +37,7 @@ def _update(self): def setup_repo(self): """ Set up a git repository at the destination. - If destination already exists and override == True, - nothing is done + If destination already exists, update it. """ if not self.folder.exists():