mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 03:49:32 +02:00
devtool: upgrade: fix renaming of recipe if PV is not in name
If the actual value of PV isn't in the name of the recipe (for example, a git or svn recipe) there's no point trying to rename it. Additionally, we already have the original filename, there's no need to guess it - just pass it in. (From OE-Core rev: e144db3650b4a7c0a59066621905f34a5400303e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
75eeeabe3c
commit
d30cc76039
@@ -83,21 +83,19 @@ def _rename_recipe_dirs(oldpv, newpv, path):
|
|||||||
if olddir != newdir:
|
if olddir != newdir:
|
||||||
shutil.move(os.path.join(path, olddir), os.path.join(path, newdir))
|
shutil.move(os.path.join(path, olddir), os.path.join(path, newdir))
|
||||||
|
|
||||||
def _rename_recipe_file(bpn, oldpv, newpv, path):
|
def _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path):
|
||||||
oldrecipe = "%s_%s.bb" % (bpn, oldpv)
|
oldrecipe = os.path.basename(oldrecipe)
|
||||||
newrecipe = "%s_%s.bb" % (bpn, newpv)
|
if oldrecipe.endswith('_%s.bb' % oldpv):
|
||||||
if os.path.isfile(os.path.join(path, oldrecipe)):
|
newrecipe = '%s_%s.bb' % (bpn, newpv)
|
||||||
if oldrecipe != newrecipe:
|
if oldrecipe != newrecipe:
|
||||||
_run('mv %s %s' % (oldrecipe, newrecipe), cwd=path)
|
shutil.move(os.path.join(path, oldrecipe), os.path.join(path, newrecipe))
|
||||||
else:
|
else:
|
||||||
recipe = "%s_git.bb" % bpn
|
newrecipe = oldrecipe
|
||||||
if os.path.isfile(os.path.join(path, recipe)):
|
|
||||||
newrecipe = recipe
|
|
||||||
return os.path.join(path, newrecipe)
|
return os.path.join(path, newrecipe)
|
||||||
|
|
||||||
def _rename_recipe_files(bpn, oldpv, newpv, path):
|
def _rename_recipe_files(oldrecipe, bpn, oldpv, newpv, path):
|
||||||
_rename_recipe_dirs(oldpv, newpv, path)
|
_rename_recipe_dirs(oldpv, newpv, path)
|
||||||
return _rename_recipe_file(bpn, oldpv, newpv, path)
|
return _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path)
|
||||||
|
|
||||||
def _write_append(rc, srctree, same_dir, no_same_dir, rev, workspace, d):
|
def _write_append(rc, srctree, same_dir, no_same_dir, rev, workspace, d):
|
||||||
"""Writes an append file"""
|
"""Writes an append file"""
|
||||||
@@ -243,7 +241,9 @@ def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil
|
|||||||
oldpv = crd.getVar('PV', True)
|
oldpv = crd.getVar('PV', True)
|
||||||
if not newpv:
|
if not newpv:
|
||||||
newpv = oldpv
|
newpv = oldpv
|
||||||
fullpath = _rename_recipe_files(bpn, oldpv, newpv, path)
|
origpath = rd.getVar('FILE', True)
|
||||||
|
fullpath = _rename_recipe_files(origpath, bpn, oldpv, newpv, path)
|
||||||
|
logger.debug('Upgraded %s => %s' % (origpath, fullpath))
|
||||||
|
|
||||||
newvalues = {}
|
newvalues = {}
|
||||||
if _recipe_contains(rd, 'PV') and newpv != oldpv:
|
if _recipe_contains(rd, 'PV') and newpv != oldpv:
|
||||||
|
|||||||
Reference in New Issue
Block a user