mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-04 07:01:29 +00:00
When auto-hinting, also try a "minimal" package set
The minimal set is comprised of only the first level of (reverse) dependencies, before any further iterations of packages are added to the set. In some cases, the result of the full iteration will contain packages which cause problems when migrated but the minimal set, although possibly a less optimal solution, may be able to migrate successfully. It is assumed that migrating the larger set of packages will be preferred if possible, so minimal sets are tried later. Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
be28f670a5
commit
bbfaba859e
18
britney.py
18
britney.py
@ -2573,6 +2573,7 @@ class Britney:
|
|||||||
|
|
||||||
# loop on them
|
# loop on them
|
||||||
candidates = []
|
candidates = []
|
||||||
|
mincands = []
|
||||||
for e in excuses:
|
for e in excuses:
|
||||||
excuse = excuses[e]
|
excuse = excuses[e]
|
||||||
if e in self.sources['testing'] and self.sources['testing'][e][VERSION] == excuse.ver[1]:
|
if e in self.sources['testing'] and self.sources['testing'][e][VERSION] == excuse.ver[1]:
|
||||||
@ -2583,29 +2584,34 @@ class Britney:
|
|||||||
candidates.append(hint.items())
|
candidates.append(hint.items())
|
||||||
else:
|
else:
|
||||||
items = [ (e, excuse.ver[1]) ]
|
items = [ (e, excuse.ver[1]) ]
|
||||||
|
looped = False
|
||||||
for item, ver in items:
|
for item, ver in items:
|
||||||
# excuses which depend on "item" or are depended on by it
|
# excuses which depend on "item" or are depended on by it
|
||||||
items.extend( [ (x, excuses[x].ver[1]) for x in excuses if \
|
items.extend( [ (x, excuses[x].ver[1]) for x in excuses if \
|
||||||
(item in excuses[x].deps or x in excuses[item].deps) \
|
(item in excuses[x].deps or x in excuses[item].deps) \
|
||||||
and (x, excuses[x].ver[1]) not in items ] )
|
and (x, excuses[x].ver[1]) not in items ] )
|
||||||
|
if not looped and len(items) > 1:
|
||||||
|
mincands.append(items[:])
|
||||||
|
looped = True
|
||||||
if len(items) > 1:
|
if len(items) > 1:
|
||||||
candidates.append(items)
|
candidates.append(items)
|
||||||
|
|
||||||
|
for l in [ candidates, mincands ]:
|
||||||
to_skip = []
|
to_skip = []
|
||||||
for i in range(len(candidates)):
|
for i in range(len(l)):
|
||||||
for j in range(i+1, len(candidates)):
|
for j in range(i+1, len(l)):
|
||||||
if i in to_skip or j in to_skip:
|
if i in to_skip or j in to_skip:
|
||||||
# we already know this list isn't interesting
|
# we already know this list isn't interesting
|
||||||
continue
|
continue
|
||||||
elif frozenset(candidates[i]) >= frozenset(candidates[j]):
|
elif frozenset(l[i]) >= frozenset(l[j]):
|
||||||
# j is a subset of i; ignore it
|
# j is a subset of i; ignore it
|
||||||
to_skip.append(j)
|
to_skip.append(j)
|
||||||
elif frozenset(candidates[i]) <= frozenset(candidates[j]):
|
elif frozenset(l[i]) <= frozenset(l[j]):
|
||||||
# i is a subset of j; ignore it
|
# i is a subset of j; ignore it
|
||||||
to_skip.append(i)
|
to_skip.append(i)
|
||||||
for i in range(len(candidates)):
|
for i in range(len(l)):
|
||||||
if i not in to_skip:
|
if i not in to_skip:
|
||||||
self.do_hint("easy", "autohinter", [ HintItem("%s/%s" % (x[0], x[1])) for x in candidates[i] ])
|
self.do_hint("easy", "autohinter", [ HintItem("%s/%s" % (x[0], x[1])) for x in l[i] ])
|
||||||
|
|
||||||
def old_libraries(self):
|
def old_libraries(self):
|
||||||
"""Detect old libraries left in testing for smooth transitions
|
"""Detect old libraries left in testing for smooth transitions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user