From 0d7770bce09102c3d297eda80278a8b2bce11f6f Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Wed, 27 Oct 2021 09:07:36 +0200 Subject: [PATCH] pkglistgen: Skip repos without state This happens for repos we only inherit for the project config but that do not build for said architecture --- pkglistgen/tool.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkglistgen/tool.py b/pkglistgen/tool.py index c3f51b44..c0bd6b3c 100644 --- a/pkglistgen/tool.py +++ b/pkglistgen/tool.py @@ -219,6 +219,9 @@ class PkgListGen(ToolBase.ToolBase): repo = pool.add_repo(project) # check back the repo state to avoid suprises state = repository_arch_state(self.apiurl, project, reponame, arch) + if state is None: + self.logger.debug(f'Skipping {project}/{reponame}/{arch}') + continue s = f'repo-{project}-{reponame}-{arch}-{state}.solv' if not repo.add_solv(s): raise Exception('failed to add repo {}/{}/{}'.format(project, reponame, arch)) @@ -376,7 +379,6 @@ class PkgListGen(ToolBase.ToolBase): for arch in architectures: # Fetch state before mirroring in-case it changes during download. state = repository_arch_state(self.apiurl, project, repo, arch) - if state is None: # Repo might not have this architecture continue @@ -425,6 +427,8 @@ class PkgListGen(ToolBase.ToolBase): for project, repo in self.repos: # check back the repo state to avoid suprises state = repository_arch_state(self.apiurl, project, repo, arch) + if state is None: + self.logger.debug(f'Skipping {project}/{repo}/{arch}') fn = f'repo-{project}-{repo}-{arch}-{state}.solv' r = pool.add_repo('/'.join([project, repo])) if not r.add_solv(fn):