mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
rrs/tools/rrs_upgrade_history.py: Remove mp process related code
The new tinfoil API acts as a client/server so isn't need to work around creating process to avoid errors in cooker with different data revisions. Also add a try/except when create an upgrade display the error. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
parent
0eb6d3e870
commit
d5eb493806
|
@ -41,8 +41,6 @@ sys.path.insert(0, os.path.join(bitbakepath, 'lib'))
|
||||||
from bb import BBHandledException
|
from bb import BBHandledException
|
||||||
from bb.utils import vercmp_string
|
from bb.utils import vercmp_string
|
||||||
|
|
||||||
import multiprocessing as mp
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Store upgrade into RecipeUpgrade model.
|
Store upgrade into RecipeUpgrade model.
|
||||||
"""
|
"""
|
||||||
|
@ -104,19 +102,24 @@ def _create_upgrade(recipe_data, layerbranch, ct, title, info, logger, initial=F
|
||||||
(npv, _, _) = get_recipe_pv_without_srcpv(pv,
|
(npv, _, _) = get_recipe_pv_without_srcpv(pv,
|
||||||
get_pv_type(pv))
|
get_pv_type(pv))
|
||||||
|
|
||||||
if npv == 'git':
|
try:
|
||||||
logger.debug("%s: Avoiding upgrade to unversioned git." % \
|
if npv == 'git':
|
||||||
(recipe.pn))
|
logger.debug("%s: Avoiding upgrade to unversioned git." % \
|
||||||
elif ppv == 'git' or vercmp_string(ppv, npv) == -1:
|
(recipe.pn))
|
||||||
if initial is True:
|
elif ppv == 'git' or vercmp_string(ppv, npv) == -1:
|
||||||
logger.debug("%s: Update initial upgrade ( -> %s)." % \
|
if initial is True:
|
||||||
(recipe.pn, pv))
|
logger.debug("%s: Update initial upgrade ( -> %s)." % \
|
||||||
latest_upgrade.version = pv
|
(recipe.pn, pv))
|
||||||
latest_upgrade.save()
|
latest_upgrade.version = pv
|
||||||
else:
|
latest_upgrade.save()
|
||||||
logger.debug("%s: Detected upgrade (%s -> %s)" \
|
else:
|
||||||
" in ct %s." % (pn, prev_pv, pv, ct))
|
logger.debug("%s: detected upgrade (%s -> %s)" \
|
||||||
_save_upgrade(recipe, pv, ct, title, info, logger)
|
" in ct %s." % (pn, prev_pv, pv, ct))
|
||||||
|
_save_upgrade(recipe, pv, ct, title, info, logger)
|
||||||
|
except:
|
||||||
|
logger.error("%s: fail to detect upgrade (%s -> %s)" \
|
||||||
|
" in ct %s." % (pn, prev_pv, pv, ct))
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Returns a list containing the fullpaths to the recipes from a commit.
|
Returns a list containing the fullpaths to the recipes from a commit.
|
||||||
|
@ -240,22 +243,13 @@ def upgrade_history(options, logger):
|
||||||
logger.debug("Adding initial upgrade history ....")
|
logger.debug("Adding initial upgrade history ....")
|
||||||
|
|
||||||
ct = commit_list.pop(0)
|
ct = commit_list.pop(0)
|
||||||
|
do_initial(layerbranch, ct, logger)
|
||||||
# XXX: To avoid cooker parser problems due to load multiple instances
|
|
||||||
# of cooker parser with different metadata revisions.
|
|
||||||
p = mp.Process(target=do_initial, args=(layerbranch, ct, logger,))
|
|
||||||
p.start()
|
|
||||||
p.join()
|
|
||||||
|
|
||||||
logger.debug("Adding upgrade history from %s to %s ..." % (since, today))
|
logger.debug("Adding upgrade history from %s to %s ..." % (since, today))
|
||||||
for ct in commit_list:
|
for ct in commit_list:
|
||||||
if ct:
|
if ct:
|
||||||
logger.debug("Analysing commit %s ..." % ct)
|
logger.debug("Analysing commit %s ..." % ct)
|
||||||
# XXX: To avoid cooker parser problems due to load multiple instances
|
do_loop(layerbranch, ct, logger)
|
||||||
# of cooker parser with different metadata revisions.
|
|
||||||
p = mp.Process(target=do_loop, args=(layerbranch, ct, logger,))
|
|
||||||
p.start()
|
|
||||||
p.join()
|
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
parser = optparse.OptionParser(usage = """%prog [options]""")
|
parser = optparse.OptionParser(usage = """%prog [options]""")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user