From: Alexander Kanavin <alex.kanavin@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Alexander Kanavin <alex@linutronix.de>
Subject: [PATCH 4/4] devtool/upgrade: use PN instead of BPN for naming newly created upgraded recipes
Date: Wed, 17 Jul 2024 20:22:16 +0200 [thread overview]
Message-ID: <20240717182216.1661015-4-alex.kanavin@gmail.com> (raw)
In-Reply-To: <20240717182216.1661015-1-alex.kanavin@gmail.com>
From: Alexander Kanavin <alex@linutronix.de>
BPN isn't correct, as it is set to 'cmake' when 'cmake-native' is being upgraded
(or libva for libva-initial etc.)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
scripts/lib/devtool/upgrade.py | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 4c268af3a7c..9ec66488516 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -76,19 +76,19 @@ def _rename_recipe_dirs(oldpv, newpv, path):
bb.utils.rename(os.path.join(path, oldfile),
os.path.join(path, newfile))
-def _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path):
+def _rename_recipe_file(oldrecipe, pn, oldpv, newpv, path):
oldrecipe = os.path.basename(oldrecipe)
if oldrecipe.endswith('_%s.bb' % oldpv):
- newrecipe = '%s_%s.bb' % (bpn, newpv)
+ newrecipe = '%s_%s.bb' % (pn, newpv)
if oldrecipe != newrecipe:
shutil.move(os.path.join(path, oldrecipe), os.path.join(path, newrecipe))
else:
newrecipe = oldrecipe
return os.path.join(path, newrecipe)
-def _rename_recipe_files(oldrecipe, bpn, oldpv, newpv, path):
+def _rename_recipe_files(oldrecipe, pn, oldpv, newpv, path):
_rename_recipe_dirs(oldpv, newpv, path)
- return _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path)
+ return _rename_recipe_file(oldrecipe, pn, oldpv, newpv, path)
def _write_append(rc, srctreebase, srctree, same_dir, no_same_dir, revs, copied, workspace, d):
"""Writes an append file"""
@@ -335,19 +335,19 @@ def _add_license_diff_to_recipe(path, diff):
def _create_new_recipe(newpv, checksums, srcrev, srcbranch, srcsubdir_old, srcsubdir_new, workspace, tinfoil, rd, license_diff, new_licenses, srctree, keep_failure):
"""Creates the new recipe under workspace"""
- bpn = rd.getVar('BPN')
- path = os.path.join(workspace, 'recipes', bpn)
+ pn = rd.getVar('PN')
+ path = os.path.join(workspace, 'recipes', pn)
bb.utils.mkdirhier(path)
copied, _ = oe.recipeutils.copy_recipe_files(rd, path, all_variants=True)
if not copied:
- raise DevtoolError('Internal error - no files were copied for recipe %s' % bpn)
+ raise DevtoolError('Internal error - no files were copied for recipe %s' % pn)
logger.debug('Copied %s to %s' % (copied, path))
oldpv = rd.getVar('PV')
if not newpv:
newpv = oldpv
origpath = rd.getVar('FILE')
- fullpath = _rename_recipe_files(origpath, bpn, oldpv, newpv, path)
+ fullpath = _rename_recipe_files(origpath, pn, oldpv, newpv, path)
logger.debug('Upgraded %s => %s' % (origpath, fullpath))
newvalues = {}
@@ -610,7 +610,7 @@ def upgrade(args, config, basepath, workspace):
license_diff = _generate_license_diff(old_licenses, new_licenses)
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)
except (bb.process.CmdError, DevtoolError) as e:
- recipedir = os.path.join(config.workspace_path, 'recipes', rd.getVar('BPN'))
+ recipedir = os.path.join(config.workspace_path, 'recipes', rd.getVar('PN'))
_upgrade_error(e, recipedir, srctree, args.keep_failure)
standard._add_md5(config, pn, os.path.dirname(rf))
--
2.39.2
next prev parent reply other threads:[~2024-07-17 18:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-17 18:22 [PATCH 1/4] lib/oe/recipeutils: return a dict in get_recipe_upgrade_status() instead of a tuple Alexander Kanavin
2024-07-17 18:22 ` [PATCH 2/4] lib/recipeutils: add a function to determine recipes with shared include files Alexander Kanavin
2024-07-22 14:43 ` [OE-core] " Richard Purdie
2024-07-23 7:15 ` Alexander Kanavin
2024-07-23 7:21 ` Richard Purdie
2024-07-23 7:27 ` Alexander Kanavin
2024-07-17 18:22 ` [PATCH 3/4] recipeutils/get_recipe_upgrade_status: group recipes when they need to be upgraded together Alexander Kanavin
2024-07-17 18:38 ` Patchtest results for " patchtest
2024-07-17 18:22 ` Alexander Kanavin [this message]
2024-07-17 18:38 ` Patchtest results for [PATCH 1/4] lib/oe/recipeutils: return a dict in get_recipe_upgrade_status() instead of a tuple patchtest
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240717182216.1661015-4-alex.kanavin@gmail.com \
--to=alex.kanavin@gmail.com \
--cc=alex@linutronix.de \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox