|
|
@ -960,7 +960,7 @@ class Britney:
|
|
|
|
|
|
|
|
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
|
|
def get_dependency_solvers(self, block, arch, distribution, strict=False):
|
|
|
|
def get_dependency_solvers(self, block, arch, distribution):
|
|
|
|
"""Find the packages which satisfy a dependency block
|
|
|
|
"""Find the packages which satisfy a dependency block
|
|
|
|
|
|
|
|
|
|
|
|
This method returns the list of packages which satisfy a dependency
|
|
|
|
This method returns the list of packages which satisfy a dependency
|
|
|
@ -990,11 +990,9 @@ class Britney:
|
|
|
|
for prov in binaries[1].get(name, []):
|
|
|
|
for prov in binaries[1].get(name, []):
|
|
|
|
if prov not in binaries[0]: continue
|
|
|
|
if prov not in binaries[0]: continue
|
|
|
|
package = binaries[0][prov]
|
|
|
|
package = binaries[0][prov]
|
|
|
|
# check the versioned dependency (if present)
|
|
|
|
# A provides only satisfies an unversioned dependency
|
|
|
|
# TODO: this is forbidden by the debian policy, which says that versioned
|
|
|
|
# (per Policy Manual §7.5)
|
|
|
|
# dependencies on virtual packages are never satisfied. The old britney
|
|
|
|
if op == '' and version == '':
|
|
|
|
# does it and we have to go with it, but at least a warning should be raised.
|
|
|
|
|
|
|
|
if op == '' and version == '' or not strict and apt_pkg.check_dep(package[VERSION], op, version):
|
|
|
|
|
|
|
|
packages.append(prov)
|
|
|
|
packages.append(prov)
|
|
|
|
|
|
|
|
|
|
|
|
return (len(packages) > 0, packages)
|
|
|
|
return (len(packages) > 0, packages)
|
|
|
@ -1016,7 +1014,6 @@ class Britney:
|
|
|
|
# local copies for better performances
|
|
|
|
# local copies for better performances
|
|
|
|
parse_depends = apt_pkg.parse_depends
|
|
|
|
parse_depends = apt_pkg.parse_depends
|
|
|
|
get_dependency_solvers = self.get_dependency_solvers
|
|
|
|
get_dependency_solvers = self.get_dependency_solvers
|
|
|
|
strict = True # not self.options.compatible
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# analyze the dependency fields (if present)
|
|
|
|
# analyze the dependency fields (if present)
|
|
|
|
for type_key, type in ((PREDEPENDS, 'Pre-Depends'), (DEPENDS, 'Depends')):
|
|
|
|
for type_key, type in ((PREDEPENDS, 'Pre-Depends'), (DEPENDS, 'Depends')):
|
|
|
@ -1026,7 +1023,7 @@ class Britney:
|
|
|
|
# for every block of dependency (which is formed as conjunction of disconjunction)
|
|
|
|
# for every block of dependency (which is formed as conjunction of disconjunction)
|
|
|
|
for block, block_txt in zip(parse_depends(binary_u[type_key]), binary_u[type_key].split(',')):
|
|
|
|
for block, block_txt in zip(parse_depends(binary_u[type_key]), binary_u[type_key].split(',')):
|
|
|
|
# if the block is satisfied in testing, then skip the block
|
|
|
|
# if the block is satisfied in testing, then skip the block
|
|
|
|
solved, packages = get_dependency_solvers(block, arch, 'testing', strict=strict)
|
|
|
|
solved, packages = get_dependency_solvers(block, arch, 'testing')
|
|
|
|
if solved:
|
|
|
|
if solved:
|
|
|
|
for p in packages:
|
|
|
|
for p in packages:
|
|
|
|
if p not in self.binaries[suite][arch][0]: continue
|
|
|
|
if p not in self.binaries[suite][arch][0]: continue
|
|
|
@ -1034,7 +1031,7 @@ class Britney:
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
# check if the block can be satisfied in unstable, and list the solving packages
|
|
|
|
# check if the block can be satisfied in unstable, and list the solving packages
|
|
|
|
solved, packages = get_dependency_solvers(block, arch, suite, strict=strict)
|
|
|
|
solved, packages = get_dependency_solvers(block, arch, suite)
|
|
|
|
packages = [self.binaries[suite][arch][0][p][SOURCE] for p in packages]
|
|
|
|
packages = [self.binaries[suite][arch][0][p][SOURCE] for p in packages]
|
|
|
|
|
|
|
|
|
|
|
|
# if the dependency can be satisfied by the same source package, skip the block:
|
|
|
|
# if the dependency can be satisfied by the same source package, skip the block:
|
|
|
|