From c6588645438b85b7f3407e6575d60ebecdcbbf2a Mon Sep 17 00:00:00 2001 From: "Ivan A. Melnikov" Date: Fri, 3 Sep 2021 18:15:20 +0400 Subject: [PATCH] repos: Store platform word size in a special repo field --- port_stats/repos.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/port_stats/repos.py b/port_stats/repos.py index feb2d24..365849e 100644 --- a/port_stats/repos.py +++ b/port_stats/repos.py @@ -127,17 +127,22 @@ class Binary: class Repository: - def __init__(self, repo_name, sources, binaries): + def __init__(self, repo_name, sources, binaries, bits=None): self.name = repo_name self.sources = sources self.binaries = binaries + if bits is not None: + self.bits = bits + else: + self.bits = 64 if ('64' in self.name) else 32 self.reverse_prov = {} # name -> [(provide, binary)] self.update_indexes() def copy(self, new_name): return Repository(new_name, dict(self.sources), - dict(self.binaries)) + dict(self.binaries), + self.bits) def update_indexes(self): rprov = collections.defaultdict(list) @@ -242,7 +247,8 @@ def _raw_build_report(from_repo, to_repo, source_name): result = set() srpm = from_repo.sources[source_name] # XXX: assumes from_repo is x86_64 - translate = '64' not in to_repo.name + assert from_repo.bits == 64 + translate = (to_repo.bits != 64) missing_buidreqs = (dep for dep in srpm.requires if not any(to_repo.providers(dep))) @@ -361,4 +367,5 @@ if __name__ == '__main__': CONFIG = interactive_setup() riscv64 = Repository.load_from_config('sisyphus_riscv64', CONFIG) x86_64 = Repository.load_from_config('sisyphus', CONFIG) + x86_64.bits = 64 mipsel = Repository.load_from_config('sisyphus_mipsel', CONFIG)