summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorJohn Edward Broadbent <jebr@google.com>2022-10-06 11:22:57 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-10-27 16:54:43 +0100
commita83b2d8200ebd10236d6c74aeb96b7ac2d6c113e (patch)
tree0c9eee1a475e6da9f13dcfb37bfb491d92cba51a /meta/classes
parent7bf5de9a3f56d23ae18acc2976fc079a5ca2c203 (diff)
downloadpoky-a83b2d8200ebd10236d6c74aeb96b7ac2d6c113e.tar.gz
externalsrc: git submodule--helper list unsupported
Git has removed support for "git submodule--helper list". https://github.com/git/git/commit/31955475d1c283120d5d84247eb3fd55d9f5fdd9 This change provides an alternate method for gathering the submodules information. Tested: Build recipes with and without submodules (From OE-Core rev: 6c50d83af0af677c2dff864ac40c580ae446372b) Signed-off-by: Carson Labrado <clabrado@google.com> Signed-off-by: John Edward Broadbent <jebr@google.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6d9364e5f3535954f65cbbc694ee7933ac1d664f) 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.bbclass19
1 files changed, 10 insertions, 9 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 0e0a3ae89c..291fcf5653 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -225,15 +225,16 @@ 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 submodule_helper = subprocess.check_output(['git', 'submodule--helper', 'list'], cwd=s_dir, env=env).decode("utf-8") 228 if os.path.exists(".gitmodules"):
229 for line in submodule_helper.splitlines(): 229 submodule_helper = subprocess.check_output(["git", "config", "--file", ".gitmodules", "--get-regexp", "path"], cwd=s_dir, env=env).decode("utf-8")
230 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) 230 for line in submodule_helper.splitlines():
231 if os.path.isdir(module_dir): 231 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1])
232 proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 232 if os.path.isdir(module_dir):
233 proc.communicate() 233 proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
234 proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) 234 proc.communicate()
235 stdout, _ = proc.communicate() 235 proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
236 git_sha1 += stdout.decode("utf-8") 236 stdout, _ = proc.communicate()
237 git_sha1 += stdout.decode("utf-8")
237 sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest() 238 sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest()
238 with open(oe_hash_file, 'w') as fobj: 239 with open(oe_hash_file, 'w') as fobj:
239 fobj.write(sha1) 240 fobj.write(sha1)