diff options
author | Peter Marko <peter.marko@siemens.com> | 2022-12-01 15:04:40 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-08 10:48:36 +0000 |
commit | f4d5ffd4d8ca06a44ad292159068c2f54912a942 (patch) | |
tree | afaf89657128c6b714569740b963788f70542a74 /meta/classes | |
parent | b85e19d17b6fbcf59758c693a341aef8cd780de6 (diff) | |
download | poky-f4d5ffd4d8ca06a44ad292159068c2f54912a942.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: 66ff3d1f65cd2e7f5319e98fa41f47a59b714c72)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/externalsrc.bbclass | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index 75fb91bcb0..0deb5dbf5f 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass | |||
@@ -230,7 +230,7 @@ def srctree_hash_files(d, srcdir=None): | |||
230 | env['GIT_INDEX_FILE'] = tmp_index.name | 230 | env['GIT_INDEX_FILE'] = tmp_index.name |
231 | subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env) | 231 | subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env) |
232 | git_sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8") | 232 | git_sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8") |
233 | if os.path.exists(".gitmodules"): | 233 | if os.path.exists(os.path.join(s_dir, ".gitmodules")): |
234 | submodule_helper = subprocess.check_output(["git", "config", "--file", ".gitmodules", "--get-regexp", "path"], cwd=s_dir, env=env).decode("utf-8") | 234 | submodule_helper = subprocess.check_output(["git", "config", "--file", ".gitmodules", "--get-regexp", "path"], cwd=s_dir, env=env).decode("utf-8") |
235 | for line in submodule_helper.splitlines(): | 235 | for line in submodule_helper.splitlines(): |
236 | module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) | 236 | module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) |