Also tie break libpythonXX.
This commit is contained in:
parent
8efbae883d
commit
b31ac7b50e
1 changed files with 10 additions and 4 deletions
|
@ -115,7 +115,6 @@ from ..buildlog import problem_to_upstream_requirement
|
||||||
from ..fix_build import BuildFixer, resolve_error
|
from ..fix_build import BuildFixer, resolve_error
|
||||||
from ..resolver.apt import (
|
from ..resolver.apt import (
|
||||||
AptRequirement,
|
AptRequirement,
|
||||||
get_package_for_python_module,
|
|
||||||
)
|
)
|
||||||
from .build import attempt_build, DEFAULT_BUILDER
|
from .build import attempt_build, DEFAULT_BUILDER
|
||||||
|
|
||||||
|
@ -292,13 +291,20 @@ def python_tie_breaker(tree, subpath, reqs):
|
||||||
targeted = targeted_python_versions(tree, subpath)
|
targeted = targeted_python_versions(tree, subpath)
|
||||||
if not targeted:
|
if not targeted:
|
||||||
return None
|
return None
|
||||||
for prefix in targeted:
|
|
||||||
|
def same(pkg, python_version):
|
||||||
|
if pkg.startswith(python_version + '-'):
|
||||||
|
return True
|
||||||
|
if pkg.startswith('lib%s-' % python_version):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
for python_version in targeted:
|
||||||
for req in reqs:
|
for req in reqs:
|
||||||
if any(name.startswith(prefix + '-') for name in req.package_names()):
|
if any(same(name, python_version) for name in req.package_names()):
|
||||||
logging.info(
|
logging.info(
|
||||||
'Breaking tie between %r to %r, since package already '
|
'Breaking tie between %r to %r, since package already '
|
||||||
'has %r build-dependencies', [str(req) for req in reqs],
|
'has %r build-dependencies', [str(req) for req in reqs],
|
||||||
str(req), prefix)
|
str(req), python_version)
|
||||||
return req
|
return req
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue