diff mbox series

externalsrc: fix appends with --no-same-dir flag

Message ID 20221221044348.808000-1-tashana.buys@digi.com
State New
Headers show
Series externalsrc: fix appends with --no-same-dir flag | expand

Commit Message

Tashana Buys Dec. 21, 2022, 4:43 a.m. UTC
A fix was made to meta/classes/externalsrc.bbclass that involved adding
a check for a .gitmodules file which caused the error that's been
addressed. This check failed when trying to bitbake when a git
repository has been added to workspace/appends with the "--no-same-dir"
flag defined for devtool modify. The problem is that .gitmodules is
being searched for in the wrong directory. The file is found but the
modified repo isn't a git umbrella so has no submodules. The command
following is supposed to change the working directory to "s_dir" but
fails because it is expecting to run in a repo with submodules.

Signed-off-by: Tashana Buys <tashana.buys@digi.com>
---
 meta/classes/externalsrc.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Marko Dec. 21, 2022, 8:42 a.m. UTC | #1
This is already fixed on master, you should pull the latest version.
I have also seen it in queue for langdale and kirkstone and hope to see this in dunfell, too.

Peter
diff mbox series

Patch

diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index a6a8ca6318..35c0fe0557 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -229,7 +229,7 @@  def srctree_hash_files(d, srcdir=None):
             env['GIT_INDEX_FILE'] = tmp_index.name
             subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env)
             git_sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8")
-            if os.path.exists(".gitmodules"):
+            if os.path.exists(os.path.join(s_dir, '.gitmodules')):
                 submodule_helper = subprocess.check_output(["git", "config", "--file", ".gitmodules", "--get-regexp", "path"], cwd=s_dir, env=env).decode("utf-8")
                 for line in submodule_helper.splitlines():
                     module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1])