summaryrefslogtreecommitdiffstats
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-13 07:44:09 +0000
commit81a5f765112ea275835eb5bed9d2296bd671c3c4 (patch)
tree56cad4d04fe458853ed4af0ddd04c637a56dcbaf
parent25ace795108310a71a65f997726549c307969ec2 (diff)
downloadpoky-81a5f765112ea275835eb5bed9d2296bd671c3c4.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: 077edd3992683985f0779afc73d4207a795ced39) 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>
-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 ed118afada..9c9451e528 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(os.path.join(s_dir, ".gitmodules")): 228 if os.path.exists(os.path.join(s_dir, ".gitmodules")) and os.path.getsize(os.path.join(s_dir, ".gitmodules")) > 0:
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])