mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
recipeutils/get_recipe_upgrade_status: group recipes when they need to be upgraded together
This will allow 'lockstep upgrades' of such recipes, improving success
rates in automated version updating process.
devtool check-upgrade-status now prints:
These recipes need to be upgraded together {
glib-2.0 2.80.2 2.80.4 Anuj Mittal <anuj.mittal@intel.com>
glib-2.0-initial 2.80.2 2.80.4 Anuj Mittal <anuj.mittal@intel.com>
}
These recipes need to be upgraded together {
util-linux 2.39.3 2.40.2 Chen Qi <Qi.Chen@windriver.com>
util-linux-libuuid 2.39.3 2.40.2 Chen Qi <Qi.Chen@windriver.com>
}
These recipes need to be upgraded together {
cmake 3.29.3 3.30.0 Unassigned <unassigned@yoctoproject.org>
cmake-native 3.29.3 3.30.0 Unassigned <unassigned@yoctoproject.org>
}
etc.
(From OE-Core rev: 7874aea5c62be3e8dbd19e04fce5389c5ed7aab6)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
bd18497110
commit
3d98aafc43
@@ -1154,6 +1154,7 @@ def get_recipe_upgrade_status(recipes=None):
|
||||
if not recipes:
|
||||
recipes = tinfoil.all_recipe_files(variants=False)
|
||||
|
||||
recipeincludes = {}
|
||||
for fn in recipes:
|
||||
try:
|
||||
if fn.startswith("/"):
|
||||
@@ -1178,11 +1179,13 @@ def get_recipe_upgrade_status(recipes=None):
|
||||
|
||||
data_copy_list.append(data_copy)
|
||||
|
||||
recipeincludes[data.getVar('FILE')] = {'bbincluded':data.getVar('BBINCLUDED').split(),'pn':data.getVar('PN')}
|
||||
|
||||
from concurrent.futures import ProcessPoolExecutor
|
||||
with ProcessPoolExecutor(max_workers=utils.cpu_count()) as executor:
|
||||
pkgs_list = executor.map(_get_recipe_upgrade_status, data_copy_list)
|
||||
|
||||
return pkgs_list
|
||||
return _group_recipes(pkgs_list, _get_common_include_recipes(recipeincludes))
|
||||
|
||||
def get_common_include_recipes():
|
||||
with bb.tinfoil.Tinfoil() as tinfoil:
|
||||
@@ -1220,3 +1223,21 @@ def _get_common_include_recipes(recipeincludes_all):
|
||||
recipes_with_shared_includes.append(recipeset)
|
||||
|
||||
return recipes_with_shared_includes
|
||||
|
||||
def _group_recipes(recipes, groups):
|
||||
recipedict = {}
|
||||
for r in recipes:
|
||||
recipedict[r['pn']] = r
|
||||
|
||||
recipegroups = []
|
||||
for g in groups:
|
||||
recipeset = []
|
||||
for r in g:
|
||||
if r in recipedict.keys():
|
||||
recipeset.append(recipedict[r])
|
||||
del recipedict[r]
|
||||
recipegroups.append(recipeset)
|
||||
|
||||
for r in recipedict.values():
|
||||
recipegroups.append([r])
|
||||
return recipegroups
|
||||
|
||||
@@ -20,10 +20,10 @@ class Distrodata(OESelftestTestCase):
|
||||
feature = 'LICENSE_FLAGS_ACCEPTED += " commercial"\n'
|
||||
self.write_config(feature)
|
||||
|
||||
pkgs = oe.recipeutils.get_recipe_upgrade_status()
|
||||
pkggroups = oe.recipeutils.get_recipe_upgrade_status()
|
||||
|
||||
regressed_failures = [pkg['pn'] for pkg in pkgs if pkg['status'] == 'UNKNOWN_BROKEN']
|
||||
regressed_successes = [pkg['pn'] for pkg in pkgs if pkg['status'] == 'KNOWN_BROKEN']
|
||||
regressed_failures = [pkg['pn'] for pkgs in pkggroups for pkg in pkgs if pkg['status'] == 'UNKNOWN_BROKEN']
|
||||
regressed_successes = [pkg['pn'] for pkgs in pkggroups for pkg in pkgs if pkg['status'] == 'KNOWN_BROKEN']
|
||||
msg = ""
|
||||
if len(regressed_failures) > 0:
|
||||
msg = msg + """
|
||||
|
||||
Reference in New Issue
Block a user