mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-28 10:51:31 +00:00
Split calculating and running of auto-hinter hints
Signed-off-by: Ivo De Decker <ivodd@debian.org>
This commit is contained in:
parent
12187421c8
commit
22c6be76ba
10
britney.py
10
britney.py
@ -1836,7 +1836,7 @@ class Britney(object):
|
|||||||
hintcnt += 1
|
hintcnt += 1
|
||||||
|
|
||||||
# run the auto hinter
|
# run the auto hinter
|
||||||
self.auto_hinter()
|
self.run_auto_hinter()
|
||||||
|
|
||||||
if getattr(self.options, "remove_obsolete", "yes") == "yes":
|
if getattr(self.options, "remove_obsolete", "yes") == "yes":
|
||||||
# obsolete source packages
|
# obsolete source packages
|
||||||
@ -2025,7 +2025,7 @@ class Britney(object):
|
|||||||
self.do_all(hinttype, _pkgvers)
|
self.do_all(hinttype, _pkgvers)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def auto_hinter(self):
|
def get_auto_hinter_hints(self, upgrade_me):
|
||||||
"""Auto-generate "easy" hints.
|
"""Auto-generate "easy" hints.
|
||||||
|
|
||||||
This method attempts to generate "easy" hints for sets of packages which
|
This method attempts to generate "easy" hints for sets of packages which
|
||||||
@ -2047,7 +2047,7 @@ class Britney(object):
|
|||||||
excuses = self.excuses
|
excuses = self.excuses
|
||||||
|
|
||||||
# consider only excuses which are valid candidates and still relevant.
|
# consider only excuses which are valid candidates and still relevant.
|
||||||
valid_excuses = frozenset(y.uvname for y in self.upgrade_me
|
valid_excuses = frozenset(y.uvname for y in upgrade_me
|
||||||
if y not in sources_t or sources_t[y].version != excuses[y].ver[1])
|
if y not in sources_t or sources_t[y].version != excuses[y].ver[1])
|
||||||
excuses_deps = {name: valid_excuses.intersection(excuse.deps)
|
excuses_deps = {name: valid_excuses.intersection(excuse.deps)
|
||||||
for name, excuse in excuses.items() if name in valid_excuses}
|
for name, excuse in excuses.items() if name in valid_excuses}
|
||||||
@ -2108,8 +2108,10 @@ class Britney(object):
|
|||||||
if h != mincands[-1] and h not in seen_hints:
|
if h != mincands[-1] and h not in seen_hints:
|
||||||
candidates.append(h)
|
candidates.append(h)
|
||||||
seen_hints.add(h)
|
seen_hints.add(h)
|
||||||
|
return [ candidates, mincands ]
|
||||||
|
|
||||||
for l in [ candidates, mincands ]:
|
def run_auto_hinter(self):
|
||||||
|
for l in self.get_auto_hinter_hints(self.upgrade_me):
|
||||||
for hint in l:
|
for hint in l:
|
||||||
self.do_hint("easy", "autohinter", [ MigrationItem("%s/%s" % (x[0], x[1])) for x in sorted(hint) ])
|
self.do_hint("easy", "autohinter", [ MigrationItem("%s/%s" % (x[0], x[1])) for x in sorted(hint) ])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user