mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-13 11:31:38 +00:00
Merge Pre-Depends into Depends
This commit is contained in:
parent
86bde62017
commit
82b9eda016
36
britney.py
36
britney.py
@ -228,7 +228,9 @@ FAKESRC = 4
|
|||||||
SOURCE = 2
|
SOURCE = 2
|
||||||
SOURCEVER = 3
|
SOURCEVER = 3
|
||||||
ARCHITECTURE = 4
|
ARCHITECTURE = 4
|
||||||
PREDEPENDS = 5
|
# PREDEPENDS = 5 - No longer used by the python code
|
||||||
|
# - The C-code needs it for alignment reasons and still check it
|
||||||
|
# but ignore it if it is None (so keep it None).
|
||||||
DEPENDS = 6
|
DEPENDS = 6
|
||||||
CONFLICTS = 7
|
CONFLICTS = 7
|
||||||
PROVIDES = 8
|
PROVIDES = 8
|
||||||
@ -511,6 +513,16 @@ class Britney(object):
|
|||||||
if pkg in packages and apt_pkg.version_compare(packages[pkg][0], version) > 0:
|
if pkg in packages and apt_pkg.version_compare(packages[pkg][0], version) > 0:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# Merge Pre-Depends with Depends and Conflicts with
|
||||||
|
# Breaks. Britney is not interested in the "finer
|
||||||
|
# semantical differences" of these fields anyway.
|
||||||
|
pdeps = get_field('Pre-Depends')
|
||||||
|
deps = get_field('Depends')
|
||||||
|
if deps and pdeps:
|
||||||
|
deps = pdeps + ', ' + deps
|
||||||
|
elif pdeps:
|
||||||
|
deps = pdeps
|
||||||
|
|
||||||
final_conflicts_list = []
|
final_conflicts_list = []
|
||||||
conflicts = get_field('Conflicts')
|
conflicts = get_field('Conflicts')
|
||||||
if conflicts:
|
if conflicts:
|
||||||
@ -523,8 +535,8 @@ class Britney(object):
|
|||||||
pkg,
|
pkg,
|
||||||
version,
|
version,
|
||||||
get_field('Architecture'),
|
get_field('Architecture'),
|
||||||
get_field('Pre-Depends'),
|
None, # Pre-depends - leave as None for the C-code
|
||||||
get_field('Depends'),
|
deps,
|
||||||
', '.join(final_conflicts_list) or None,
|
', '.join(final_conflicts_list) or None,
|
||||||
get_field('Provides'),
|
get_field('Provides'),
|
||||||
[],
|
[],
|
||||||
@ -580,8 +592,6 @@ class Britney(object):
|
|||||||
dependencies = []
|
dependencies = []
|
||||||
if packages[pkg][DEPENDS]:
|
if packages[pkg][DEPENDS]:
|
||||||
dependencies.extend(parse_depends(packages[pkg][DEPENDS], False))
|
dependencies.extend(parse_depends(packages[pkg][DEPENDS], False))
|
||||||
if packages[pkg][PREDEPENDS]:
|
|
||||||
dependencies.extend(parse_depends(packages[pkg][PREDEPENDS], False))
|
|
||||||
# go through the list
|
# go through the list
|
||||||
for p in dependencies:
|
for p in dependencies:
|
||||||
for a in p:
|
for a in p:
|
||||||
@ -912,7 +922,7 @@ class Britney(object):
|
|||||||
for pkg in binaries:
|
for pkg in binaries:
|
||||||
output = "Package: %s\n" % pkg
|
output = "Package: %s\n" % pkg
|
||||||
for key, k in ((SECTION, 'Section'), (ARCHITECTURE, 'Architecture'), (SOURCE, 'Source'), (VERSION, 'Version'),
|
for key, k in ((SECTION, 'Section'), (ARCHITECTURE, 'Architecture'), (SOURCE, 'Source'), (VERSION, 'Version'),
|
||||||
(PREDEPENDS, 'Pre-Depends'), (DEPENDS, 'Depends'), (PROVIDES, 'Provides'), (CONFLICTS, 'Conflicts')):
|
(DEPENDS, 'Depends'), (PROVIDES, 'Provides'), (CONFLICTS, 'Conflicts')):
|
||||||
if not binaries[pkg][key]: continue
|
if not binaries[pkg][key]: continue
|
||||||
if key == SOURCE:
|
if key == SOURCE:
|
||||||
if binaries[pkg][SOURCE] == pkg:
|
if binaries[pkg][SOURCE] == pkg:
|
||||||
@ -1033,8 +1043,6 @@ class Britney(object):
|
|||||||
architecture `arch' within the suite `suite'. If the dependency can't
|
architecture `arch' within the suite `suite'. If the dependency can't
|
||||||
be satisfied in testing and/or unstable, it updates the excuse passed
|
be satisfied in testing and/or unstable, it updates the excuse passed
|
||||||
as parameter.
|
as parameter.
|
||||||
|
|
||||||
The dependency fields checked are Pre-Depends and Depends.
|
|
||||||
"""
|
"""
|
||||||
# retrieve the binary package from the specified suite and arch
|
# retrieve the binary package from the specified suite and arch
|
||||||
binary_u = self.binaries[suite][arch][0][pkg]
|
binary_u = self.binaries[suite][arch][0][pkg]
|
||||||
@ -1044,12 +1052,12 @@ class Britney(object):
|
|||||||
get_dependency_solvers = self.get_dependency_solvers
|
get_dependency_solvers = self.get_dependency_solvers
|
||||||
|
|
||||||
# analyze the dependency fields (if present)
|
# analyze the dependency fields (if present)
|
||||||
for type_key, type in ((PREDEPENDS, 'Pre-Depends'), (DEPENDS, 'Depends')):
|
if not binary_u[DEPENDS]:
|
||||||
if not binary_u[type_key]:
|
return
|
||||||
continue
|
deps = binary_u[DEPENDS]
|
||||||
|
|
||||||
# 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], False), binary_u[type_key].split(',')):
|
for block, block_txt in zip(parse_depends(deps, False), deps.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')
|
solved, packages = get_dependency_solvers(block, arch, 'testing')
|
||||||
if solved:
|
if solved:
|
||||||
@ -1068,7 +1076,7 @@ class Britney(object):
|
|||||||
|
|
||||||
# if no package can satisfy the dependency, add this information to the excuse
|
# if no package can satisfy the dependency, add this information to the excuse
|
||||||
if len(packages) == 0:
|
if len(packages) == 0:
|
||||||
excuse.addhtml("%s/%s unsatisfiable %s: %s" % (pkg, arch, type, block_txt.strip()))
|
excuse.addhtml("%s/%s unsatisfiable Depends: %s" % (pkg, arch, block_txt.strip()))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# for the solving packages, update the excuse to add the dependencies
|
# for the solving packages, update the excuse to add the dependencies
|
||||||
@ -1860,8 +1868,6 @@ class Britney(object):
|
|||||||
deps = []
|
deps = []
|
||||||
if bin[DEPENDS] is not None:
|
if bin[DEPENDS] is not None:
|
||||||
deps.extend(apt_pkg.parse_depends(bin[DEPENDS], False))
|
deps.extend(apt_pkg.parse_depends(bin[DEPENDS], False))
|
||||||
if bin[PREDEPENDS] is not None:
|
|
||||||
deps.extend(apt_pkg.parse_depends(bin[PREDEPENDS], False))
|
|
||||||
if any(binary == entry[0] for deplist in deps for entry in deplist):
|
if any(binary == entry[0] for deplist in deps for entry in deplist):
|
||||||
smoothbins.append(p)
|
smoothbins.append(p)
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user