From cd849b18123a79617c16e5503dffdc58aa149aa3 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 19 May 2024 20:27:37 +0200 Subject: depcheck: correctly handle alternative dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dropping alternatives is not as simple as it seems. Alternatives are actually kept when the package name is equal. Hence foo (>> ...) | foo (<< ...) actually works and is able to select the latter alternative. We already strip alternatives via --deb-emulate-sbuild, so stripping in Python makes the dose input slightly smaller and slightly wrong. Skip doing so. mariadb now Build-Depends: libfmt-dev (>= 10.2.2) | libfmt-dev (<< 10) and the actual libfmt-dev is 9.x. Reported-by: Otto Kekäläinen --- depcheck.py | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'depcheck.py') diff --git a/depcheck.py b/depcheck.py index 34ad497..3ac7daa 100755 --- a/depcheck.py +++ b/depcheck.py @@ -294,15 +294,6 @@ def strip_dict(dct, keepfields): for k in keys: del dct[k] -def strip_alternatvies(dct, fields): - for f in fields: - try: - value = dct[f] - except KeyError: - continue - dct[f] = ",".join(dep.split("|", 1)[0] - for dep in value.split(",")) - def latest_versions(pkgs): packages = {} for p in pkgs: @@ -350,7 +341,6 @@ def make_source_list(mirror, hostarch): if any(arch_match(hostarch, pattern) for pattern in p["Architecture"].split()): strip_dict(p, srcfields) - strip_alternatvies(p, srcdepfields) yield p else: # dummy entry preventing older matching versions -- cgit v1.2.3