mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-23 08:21:30 +00:00
Make the auto-hinter more intelligent.
Rather than only considering pairs of packages, we start from a "leaf" package (i.e. one with an excuse which declares no dependencies on other packages' excuses) and recursively build a list of packages which are the dependency or reverse dependency of a package already in the list. Any list which is a subset of another list is ignored and the remaining items are then processed as "easy" hints. Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
1f909bca4d
commit
0b4c63a832
37
britney.py
37
britney.py
@ -2848,20 +2848,37 @@ class Britney:
|
|||||||
return hint
|
return hint
|
||||||
|
|
||||||
# loop on them
|
# loop on them
|
||||||
cache = []
|
candidates = []
|
||||||
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] or \
|
if e in self.sources['testing'] and self.sources['testing'][e][VERSION] == excuse.ver[1]:
|
||||||
len(excuse.deps) == 0:
|
|
||||||
continue
|
continue
|
||||||
hint = find_related(e, {})
|
if len(excuse.deps) > 0:
|
||||||
if isinstance(hint, dict) and len(hint) and hint not in cache:
|
|
||||||
self.do_hint("easy", "autohinter", hint.items())
|
|
||||||
cache.append(hint)
|
|
||||||
hint = find_related(e, {}, True)
|
hint = find_related(e, {}, True)
|
||||||
if isinstance(hint, dict) and e in hint and hint not in cache:
|
if isinstance(hint, dict) and e in hint and hint not in candidates:
|
||||||
self.do_hint("easy", "autohinter", hint.items())
|
candidates.append(hint.items())
|
||||||
cache.append(hint)
|
else:
|
||||||
|
items = [ (e, excuse.ver[1]) ]
|
||||||
|
for item, ver in items:
|
||||||
|
# excuses which depend on "item" or are depended on by it
|
||||||
|
items.extend( [ (x, excuses[x].ver[1]) for x in excuses if \
|
||||||
|
(item in excuses[x].deps or x in excuses[item].deps) \
|
||||||
|
and (x, excuses[x].ver[1]) not in items ] )
|
||||||
|
if len(items) > 1:
|
||||||
|
candidates.append(items)
|
||||||
|
|
||||||
|
to_skip = []
|
||||||
|
for i in range(len(candidates)):
|
||||||
|
for j in range(i+1, len(candidates)):
|
||||||
|
if i in to_skip or j in to_skip:
|
||||||
|
continue
|
||||||
|
elif frozenset(candidates[i]) >= frozenset(candidates[j]):
|
||||||
|
to_skip.append(j)
|
||||||
|
elif frozenset(candidates[i]) <= frozenset(candidates[j]):
|
||||||
|
to_skip.append(i)
|
||||||
|
for i in range(len(candidates)):
|
||||||
|
if i not in to_skip:
|
||||||
|
self.do_hint("easy", "autohinter", candidates[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