summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2022-12-01 15:04:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-06 17:33:15 +0000
commit785e988a3dd5decc6176e95d1bb595b74afd9cec (patch)
tree2669b417cf96bc542de00500e3c47b4c73613f28
parent2ef094198ed25fd3a5f98edc3ce009fe2e61c060 (diff)
downloadpoky-785e988a3dd5decc6176e95d1bb595b74afd9cec.tar.gz
externalsrc: fix lookup for .gitmodules
Commit 0533edac277080e1bd130c14df0cbac61ba01a0c broke bitbake parsing when bitbake is executed from directory with existing .gitmodules and the recipe in externalsrc does not have .gitmodules The check needs to search for .gitmodules in sources path, not cwd. iParsing recipes...ERROR: ExpansionError during parsing <path to recipe> ... bb.data_smart.ExpansionError: Failure expanding variable do_compile[file-checksums], expression was ${@srctree_hash_files(d)} which triggered exception CalledProcessError: Command '['git', 'config', '--file', '.gitmodules', '--get-regexp', 'path']' returned non-zero exit status 1. (From OE-Core rev: c58d82b98348b167b60ec3c8b9651d73b1bdfbdc) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 66ff3d1f65cd2e7f5319e98fa41f47a59b714c72) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/externalsrc.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 3f7f533cc6..ed118afada 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -225,7 +225,7 @@ def srctree_hash_files(d, srcdir=None):
225 env['GIT_INDEX_FILE'] = tmp_index.name 225 env['GIT_INDEX_FILE'] = tmp_index.name
226 subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env) 226 subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env)
227 git_sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8") 227 git_sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8")
228 if os.path.exists(".gitmodules"): 228 if os.path.exists(os.path.join(s_dir, ".gitmodules")):
229 submodule_helper = subprocess.check_output(["git", "config", "--file", ".gitmodules", "--get-regexp", "path"], cwd=s_dir, env=env).decode("utf-8") 229 submodule_helper = subprocess.check_output(["git", "config", "--file", ".gitmodules", "--get-regexp", "path"], cwd=s_dir, env=env).decode("utf-8")
230 for line in submodule_helper.splitlines(): 230 for line in submodule_helper.splitlines():
231 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) 231 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1])