diff options
author | Thomas Roos <throos@amazon.de> | 2023-01-16 15:30:22 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-18 16:42:28 +0000 |
commit | 40eedd67f112b00949b9ea77a8a78508ef8d36bc (patch) | |
tree | 894ef2f1920a2c1f042f741dfca0227e1bf0c048 /meta/classes/externalsrc.bbclass | |
parent | aab9a3c6976bf4435c66cc738c3d70e0dfe6718e (diff) | |
download | poky-40eedd67f112b00949b9ea77a8a78508ef8d36bc.tar.gz |
devtool: fix devtool finish when gitmodules file is empty
When a .gitmodules file exists but is empty then devtool finish fails.
Add an additional check for this.
[YOCTO #14999]
(From OE-Core rev: b4f0f7c4934bade9e4d4a1086f9d8b29d8e9ad45)
Signed-off-by: Thomas Roos <throos@amazon.de>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/externalsrc.bbclass')
-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 0deb5dbf5f..26c5803ee6 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(os.path.join(s_dir, ".gitmodules")): | 233 | if os.path.exists(os.path.join(s_dir, ".gitmodules")) and os.path.getsize(os.path.join(s_dir, ".gitmodules")) > 0: |
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]) |