summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2024-07-17 20:22:16 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-07-22 16:53:06 +0100
commit15e5193e9f4790154890774a3326784a009dff68 (patch)
tree5757e6985b0484af86fb0020c019d6446902937e /scripts/lib
parent3d98aafc43bf6d14aac997137348fe503efed04e (diff)
downloadpoky-15e5193e9f4790154890774a3326784a009dff68.tar.gz
devtool/upgrade: use PN instead of BPN for naming newly created upgraded recipes
BPN isn't correct, as it is set to 'cmake' when 'cmake-native' is being upgraded (or libva for libva-initial etc.) (From OE-Core rev: e634316547f86ce5662fa4899440a5af1047d494) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/devtool/upgrade.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 4c268af3a7..9ec6648851 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -76,19 +76,19 @@ def _rename_recipe_dirs(oldpv, newpv, path):
76 bb.utils.rename(os.path.join(path, oldfile), 76 bb.utils.rename(os.path.join(path, oldfile),
77 os.path.join(path, newfile)) 77 os.path.join(path, newfile))
78 78
79def _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path): 79def _rename_recipe_file(oldrecipe, pn, oldpv, newpv, path):
80 oldrecipe = os.path.basename(oldrecipe) 80 oldrecipe = os.path.basename(oldrecipe)
81 if oldrecipe.endswith('_%s.bb' % oldpv): 81 if oldrecipe.endswith('_%s.bb' % oldpv):
82 newrecipe = '%s_%s.bb' % (bpn, newpv) 82 newrecipe = '%s_%s.bb' % (pn, newpv)
83 if oldrecipe != newrecipe: 83 if oldrecipe != newrecipe:
84 shutil.move(os.path.join(path, oldrecipe), os.path.join(path, newrecipe)) 84 shutil.move(os.path.join(path, oldrecipe), os.path.join(path, newrecipe))
85 else: 85 else:
86 newrecipe = oldrecipe 86 newrecipe = oldrecipe
87 return os.path.join(path, newrecipe) 87 return os.path.join(path, newrecipe)
88 88
89def _rename_recipe_files(oldrecipe, bpn, oldpv, newpv, path): 89def _rename_recipe_files(oldrecipe, pn, oldpv, newpv, path):
90 _rename_recipe_dirs(oldpv, newpv, path) 90 _rename_recipe_dirs(oldpv, newpv, path)
91 return _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path) 91 return _rename_recipe_file(oldrecipe, pn, oldpv, newpv, path)
92 92
93def _write_append(rc, srctreebase, srctree, same_dir, no_same_dir, revs, copied, workspace, d): 93def _write_append(rc, srctreebase, srctree, same_dir, no_same_dir, revs, copied, workspace, d):
94 """Writes an append file""" 94 """Writes an append file"""
@@ -335,19 +335,19 @@ def _add_license_diff_to_recipe(path, diff):
335def _create_new_recipe(newpv, checksums, srcrev, srcbranch, srcsubdir_old, srcsubdir_new, workspace, tinfoil, rd, license_diff, new_licenses, srctree, keep_failure): 335def _create_new_recipe(newpv, checksums, srcrev, srcbranch, srcsubdir_old, srcsubdir_new, workspace, tinfoil, rd, license_diff, new_licenses, srctree, keep_failure):
336 """Creates the new recipe under workspace""" 336 """Creates the new recipe under workspace"""
337 337
338 bpn = rd.getVar('BPN') 338 pn = rd.getVar('PN')
339 path = os.path.join(workspace, 'recipes', bpn) 339 path = os.path.join(workspace, 'recipes', pn)
340 bb.utils.mkdirhier(path) 340 bb.utils.mkdirhier(path)
341 copied, _ = oe.recipeutils.copy_recipe_files(rd, path, all_variants=True) 341 copied, _ = oe.recipeutils.copy_recipe_files(rd, path, all_variants=True)
342 if not copied: 342 if not copied:
343 raise DevtoolError('Internal error - no files were copied for recipe %s' % bpn) 343 raise DevtoolError('Internal error - no files were copied for recipe %s' % pn)
344 logger.debug('Copied %s to %s' % (copied, path)) 344 logger.debug('Copied %s to %s' % (copied, path))
345 345
346 oldpv = rd.getVar('PV') 346 oldpv = rd.getVar('PV')
347 if not newpv: 347 if not newpv:
348 newpv = oldpv 348 newpv = oldpv
349 origpath = rd.getVar('FILE') 349 origpath = rd.getVar('FILE')
350 fullpath = _rename_recipe_files(origpath, bpn, oldpv, newpv, path) 350 fullpath = _rename_recipe_files(origpath, pn, oldpv, newpv, path)
351 logger.debug('Upgraded %s => %s' % (origpath, fullpath)) 351 logger.debug('Upgraded %s => %s' % (origpath, fullpath))
352 352
353 newvalues = {} 353 newvalues = {}
@@ -610,7 +610,7 @@ def upgrade(args, config, basepath, workspace):
610 license_diff = _generate_license_diff(old_licenses, new_licenses) 610 license_diff = _generate_license_diff(old_licenses, new_licenses)
611 rf, copied = _create_new_recipe(args.version, checksums, args.srcrev, srcbranch, srcsubdir1, srcsubdir2, config.workspace_path, tinfoil, rd, license_diff, new_licenses, srctree, args.keep_failure) 611 rf, copied = _create_new_recipe(args.version, checksums, args.srcrev, srcbranch, srcsubdir1, srcsubdir2, config.workspace_path, tinfoil, rd, license_diff, new_licenses, srctree, args.keep_failure)
612 except (bb.process.CmdError, DevtoolError) as e: 612 except (bb.process.CmdError, DevtoolError) as e:
613 recipedir = os.path.join(config.workspace_path, 'recipes', rd.getVar('BPN')) 613 recipedir = os.path.join(config.workspace_path, 'recipes', rd.getVar('PN'))
614 _upgrade_error(e, recipedir, srctree, args.keep_failure) 614 _upgrade_error(e, recipedir, srctree, args.keep_failure)
615 standard._add_md5(config, pn, os.path.dirname(rf)) 615 standard._add_md5(config, pn, os.path.dirname(rf))
616 616