Package: release.debian.org Followup-For: Bug #794194 User: [email protected] Usertags: britney Control: tags 794194 -moreinfo
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 While diving into debci/britney integration, I noticed that the Ubuntu patch to fix this issue isn't up-to-date anymore in this bug. It seems that the current implementation in Ubuntu is answering the concerns. Paul P.s. I may try to commit the fix myself to the GitHub archive, but I try to focus a little bit, so I thought to at least let this bug know. - -- System Information: Debian Release: stretch/sid APT prefers testing-debug APT policy: (500, 'testing-debug'), (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 4.8.0-2-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEWLZtSHNr6TsFLeZynFyZ6wW9dQoFAlhZDAgACgkQnFyZ6wW9 dQoI4Af+OCo5a5Bs9NEsj5gW/in6W9rub1cGDeP5yCxw3vXdX4R8xzbVAEXi4r6j fYZOtoOdCU4Q+Mtp+AYwKqeG3cqtAwC9jhSje/8/5tAMbDCDl2e/EJvoJAA78udJ b9b0TJI0SEk1vuYf1AXDKpednm4U1lhR+6N1JhEUZylsgbgv6ppPJpZr1Ufq8CvP sI4wKpXBOAx5vq7/N+PqgOA1Is6/a9/1dc+5b206gH1UpU9t7Rp/KqpAbu++4RT2 YRKGzyTx0+IoHQtBNKALt+nJjoUNOo7XcUHeZlaV8CV1l3f1dBGN+n16iU8svcQE WIFByifN0uvgRQrNoBdDDf7Vfj/eIw== =AxHY -----END PGP SIGNATURE-----
>From e5f306c5f5997d2455c6f3df56887070ac07b249 Mon Sep 17 00:00:00 2001 From: Martin Pitt <[email protected]> Date: Tue, 12 Jul 2016 09:21:15 +0200 Subject: [PATCH] Consider packages with M-A qualifiers for reverse dependencies Strip of Multi-Arch qualifiers ":any" and ":native" when building the dependency fields, as they are not part of the package name. This will fix cases like Package: ipython3 Depends: python3:any (>= 3) and include ipython3 in python3's reverse dependencies. Closes: #794194 --- britney.py | 8 ++++---- britney2/installability/builder.py | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/britney.py b/britney.py index b3f2d45..684f20d 100755 --- a/britney.py +++ b/britney.py @@ -195,7 +195,7 @@ from britney2 import SuiteInfo, SourcePackage, BinaryPackageId, BinaryPackage from britney2.consts import (SOURCE, SOURCEVER, ARCHITECTURE, CONFLICTS, DEPENDS, PROVIDES, MULTIARCH) from britney2.excuse import Excuse from britney2.hints import HintParser -from britney2.installability.builder import build_installability_tester +from britney2.installability.builder import build_installability_tester, ma_parse_depends from britney2.migrationitem import MigrationItem from britney2.policies.policy import AgePolicy, RCBugPolicy, PiupartsPolicy, PolicyVerdict from britney2.utils import (old_libraries_format, undo_changes, @@ -711,7 +711,7 @@ class Britney(object): return sources def _parse_provides(self, pkg_id, provides_raw): - parts = apt_pkg.parse_depends(provides_raw, False) + parts = ma_parse_depends(provides_raw) nprov = [] for or_clause in parts: if len(or_clause) != 1: # pragma: no cover @@ -1004,7 +1004,7 @@ class Britney(object): binary_u = binaries_s_a[pkg] # local copies for better performance - parse_depends = apt_pkg.parse_depends + parse_depends = ma_parse_depends # analyze the dependency fields (if present) deps = binary_u.depends @@ -1014,7 +1014,7 @@ class Britney(object): # for every dependency block (formed as conjunction of disjunction) - for block, block_txt in zip(parse_depends(deps, False), deps.split(',')): + for block, block_txt in zip(parse_depends(deps), deps.split(',')): # if the block is satisfied in testing, then skip the block packages = get_dependency_solvers(block, binaries_t_a, provides_t_a) if packages: diff --git a/britney2/installability/builder.py b/britney2/installability/builder.py index 034a18f..94e3ecb 100644 --- a/britney2/installability/builder.py +++ b/britney2/installability/builder.py @@ -21,6 +21,20 @@ from britney2.utils import ifilter_except, iter_except, get_dependency_solvers from britney2.installability.solver import InstallabilitySolver +def ma_parse_depends(dep_str): + """Parse a dependency string into a list of triples + + This is like apt_pkg.parse_depends but filters out :any and :native + Multi-Arch prefixes. We don't use apt_pkg.parse_depends(dep_str, True) + as that would also filter out arch specific dependencies like :amd64. + """ + res = apt_pkg.parse_depends(dep_str, False) + filtered = [] + for or_clause in res: + filtered.append([(p.replace(':any', '').replace(':native', ''), v, r) for (p, v, r) in or_clause]) + return filtered + + def build_installability_tester(binaries, archs): """Create the installability tester""" @@ -43,10 +57,10 @@ def build_installability_tester(binaries, archs): # We do not differentiate between depends and pre-depends if pkgdata.depends: - depends.extend(apt_pkg.parse_depends(pkgdata.depends, False)) + depends.extend(ma_parse_depends(pkgdata.depends)) if pkgdata.conflicts: - conflicts = apt_pkg.parse_depends(pkgdata.conflicts, False) + conflicts = ma_parse_depends(pkgdata.conflicts) with builder.relation_builder(pkg_id) as relations: -- 2.10.2

