diff mbox series

devtool: fix upgrade for recipes with git submodules

Message ID 20250811105115.33419-1-pistora.tobias@gmail.com
State New
Headers show
Series devtool: fix upgrade for recipes with git submodules | expand

Commit Message

Tobias Pistora Aug. 11, 2025, 10:51 a.m. UTC
Fixes [YOCTO #15943]

Fixes invalid path argument while calling "git rev-list" from submodule folders.
Replaced the local __run() wrapper function with _run() at "git rev-list" command calls.

Signed-off-by: Tobias Pistora <pistora.tobias@gmail.com>
---
 scripts/lib/devtool/upgrade.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alexander Kanavin Aug. 12, 2025, 8:18 a.m. UTC | #1
On Mon, 11 Aug 2025 at 12:52, Tobias Pistora via
lists.openembedded.org
<pistora.tobias=gmail.com@lists.openembedded.org> wrote:
>
> Fixes [YOCTO #15943]
>
> Fixes invalid path argument while calling "git rev-list" from submodule folders.
> Replaced the local __run() wrapper function with _run() at "git rev-list" command calls.

The patch is fine, but would it also be possible to add a selftest so
this doesn't again regress?

There is already a selftest for upgrading plain git recipes, but not
for ones with submodules:
test_devtool_upgrade_git() in meta/lib/oeqa/selftest/cases/devtool.py, using
meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb (to
avoid stepping on a recipe in meta/)

The component with submodules could perhaps be vulkan-samples.

Alex
diff mbox series

Patch

diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index d9aca6e2db..dda0a58098 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -280,7 +280,7 @@  def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
             # note is still attached to the old commit. Avoid this by making
             # sure all old devtool related commits have a note attached to them
             # (this assumes git config notes.rewriteMode is set to ignore).
-            (stdout, _) = __run('git rev-list devtool-base..%s' % target_branch)
+            (stdout, _) = _run('git rev-list devtool-base..%s' % target_branch, cwd=path)
             for rev in stdout.splitlines():
                 if not oe.patch.GitApplyTree.getNotes(path, rev):
                     oe.patch.GitApplyTree.addNote(path, rev, "dummy")
@@ -298,7 +298,7 @@  def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
                         logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
 
             # Remove any dummy notes added above.
-            (stdout, _) = __run('git rev-list devtool-base..%s' % target_branch)
+            (stdout, _) = _run('git rev-list devtool-base..%s' % target_branch, cwd=path)
             for rev in stdout.splitlines():
                 oe.patch.GitApplyTree.removeNote(path, rev, "dummy")