From 1668a348827dded295ee2d93050ff16bf212992b Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 1 Dec 2019 20:07:09 +0100 Subject: [PATCH] python2: improve python 2 package detection Some packages don't directly depend on python2 but on setuptools etc. By checking for /lib/python2.7/ in the files we find those too. --- main.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index ae0f0db..775bca3 100755 --- a/main.py +++ b/main.py @@ -1190,16 +1190,23 @@ def test() -> RouteResponse: todo[rdep.name] = rdep return len(done) - 1 - deps = [] + deps = {} for s in state.sources: for p in s.packages.values(): - if p.name.endswith("-x86_64-python2"): + if not p.repo == "mingw64": + continue + if p.name in deps: + continue + if p.name == "mingw-w64-x86_64-python2": for rdep in sorted(set([x[0] for x in p.rdepends]), key=lambda y: y.name): - deps.append((rdep, get_rdep_count(rdep), is_split_package(rdep))) - break + deps[rdep.name] = (rdep, get_rdep_count(rdep), is_split_package(rdep)) + for path in p.files: + if "/lib/python2.7/" in path: + deps[p.name] = (p, get_rdep_count(p), is_split_package(p)) + break grouped: Dict[str, Tuple[int, bool]] = {} - for p, count, split in deps: + for p, count, split in deps.values(): base = p.base if base in grouped: old_count, old_split = grouped[base]