mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-11-04 10:34:05 +00:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									8e0405d2e2
								
							
						
					
					
						commit
						e5f306c5f5
					
				@ -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:
 | 
			
		||||
 | 
			
		||||
@ -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:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user