summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorThomas Roos <throos@amazon.de>2023-01-16 15:30:22 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-04 23:32:27 +0000
commit1168dc921100a97d7c0099657a573483f337c683 (patch)
treeb0db3f4fe48392c2716772202efa0eadc086c659 /meta/classes
parent59a697e99d3f3d02c51edc1a9bddf44506bcafd6 (diff)
downloadpoky-1168dc921100a97d7c0099657a573483f337c683.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: 7bc6bb2d3f01f3c9fe42417b6cfad194f9931a3a) 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> (cherry picked from commit b4f0f7c4934bade9e4d4a1086f9d8b29d8e9ad45) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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 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])