mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
rrs/tools.py: Create standalone get_recipe_pv_without_srcpv function.
Copied get_recipe_pv_without_srcpv from oe-core/recipeutils library to avoid import errors caused by have imported twice oe-core from poky and from tinfoil. rrs/tools/rrs_upgrade_history.py: Update to use get_recipe_pv_without_srcpv from common. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
parent
d75b296349
commit
488a2351ad
|
@ -128,3 +128,27 @@ def load_recipes(layerbranch, bitbakepath, fetchdir, settings, logger,
|
||||||
continue
|
continue
|
||||||
|
|
||||||
return (tinfoil, d, recipes)
|
return (tinfoil, d, recipes)
|
||||||
|
|
||||||
|
# XXX: Copied from oe-core recipeutils to avoid import errors.
|
||||||
|
def get_recipe_pv_without_srcpv(pv, uri_type):
|
||||||
|
"""
|
||||||
|
Get PV without SRCPV common in SCM's for now only
|
||||||
|
support git.
|
||||||
|
|
||||||
|
Returns tuple with pv, prefix and suffix.
|
||||||
|
"""
|
||||||
|
import re
|
||||||
|
|
||||||
|
pfx = ''
|
||||||
|
sfx = ''
|
||||||
|
|
||||||
|
if uri_type == 'git':
|
||||||
|
git_regex = re.compile("(?P<pfx>(v|))(?P<ver>((\d+[\.\-_]*)+))(?P<sfx>(\+|)(git|)(r|)(AUTOINC|)(\+|))(?P<rev>.*)")
|
||||||
|
m = git_regex.match(pv)
|
||||||
|
|
||||||
|
if m:
|
||||||
|
pv = m.group('ver')
|
||||||
|
pfx = m.group('pfx')
|
||||||
|
sfx = m.group('sfx')
|
||||||
|
|
||||||
|
return (pv, pfx, sfx)
|
||||||
|
|
|
@ -40,14 +40,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
|
||||||
|
|
||||||
# setup poky/oecore
|
|
||||||
pokypath = update_repo(settings.LAYER_FETCH_DIR, 'poky', settings.POKY_REPO_URL,
|
|
||||||
True, logger)
|
|
||||||
# XXX: To use oe-core libraries from poky because the layer oe-core
|
|
||||||
# is checkout an old revision.
|
|
||||||
sys.path.insert(0, os.path.join(pokypath, 'meta', 'lib'))
|
|
||||||
from oe.recipeutils import get_recipe_pv_without_srcpv
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Store upgrade into RecipeUpgrade model.
|
Store upgrade into RecipeUpgrade model.
|
||||||
"""
|
"""
|
||||||
|
@ -102,6 +94,8 @@ def _create_upgrade(recipe_data, layerbranch, ct, title, info, logger, initial=F
|
||||||
logger.debug("%s: Initial upgrade ( -> %s)." % (recipe.pn, pv))
|
logger.debug("%s: Initial upgrade ( -> %s)." % (recipe.pn, pv))
|
||||||
_save_upgrade(recipe, pv, ct, title, info, logger)
|
_save_upgrade(recipe, pv, ct, title, info, logger)
|
||||||
else:
|
else:
|
||||||
|
from common import get_recipe_pv_without_srcpv
|
||||||
|
|
||||||
(ppv, _, _) = get_recipe_pv_without_srcpv(prev_pv,
|
(ppv, _, _) = get_recipe_pv_without_srcpv(prev_pv,
|
||||||
get_pv_type(prev_pv))
|
get_pv_type(prev_pv))
|
||||||
(npv, _, _) = get_recipe_pv_without_srcpv(pv,
|
(npv, _, _) = get_recipe_pv_without_srcpv(pv,
|
||||||
|
@ -189,6 +183,7 @@ def upgrade_history(options, logger):
|
||||||
ct = commit_list.pop(0)
|
ct = commit_list.pop(0)
|
||||||
utils.runcmd("git checkout %s -b %s -f" % (ct, branch_name_tmp),
|
utils.runcmd("git checkout %s -b %s -f" % (ct, branch_name_tmp),
|
||||||
repodir, logger=logger)
|
repodir, logger=logger)
|
||||||
|
utils.runcmd("git clean -dfx", repodir, logger=logger)
|
||||||
(tinfoil, d, recipes) = load_recipes(layerbranch, bitbakepath,
|
(tinfoil, d, recipes) = load_recipes(layerbranch, bitbakepath,
|
||||||
fetchdir, settings, logger, nocheckout=True)
|
fetchdir, settings, logger, nocheckout=True)
|
||||||
|
|
||||||
|
@ -208,6 +203,7 @@ def upgrade_history(options, logger):
|
||||||
|
|
||||||
utils.runcmd("git checkout %s -b %s -f" % (ct, branch_name_tmp),
|
utils.runcmd("git checkout %s -b %s -f" % (ct, branch_name_tmp),
|
||||||
repodir, logger=logger)
|
repodir, logger=logger)
|
||||||
|
utils.runcmd("git clean -dfx", repodir, logger=logger)
|
||||||
|
|
||||||
fns = _get_recipes_filenames(ct, repodir, layerdir, logger)
|
fns = _get_recipes_filenames(ct, repodir, layerdir, logger)
|
||||||
if not fns:
|
if not fns:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user