summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Edward Broadbent <jebr@google.com>2022-09-28 11:58:49 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-10 14:39:24 +0000
commit1952d2934568b0007f38cd3cca86abcaf5a881ee (patch)
tree6fdfc4f95c8046922134ddf361f78a799c35cd68
parent974cba76574458a56af337be96b6b9be73c97c79 (diff)
downloadpoky-1952d2934568b0007f38cd3cca86abcaf5a881ee.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: 0750fa73ea9ff08e844480865cc51db0c924ad0b) 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>
-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 d87363a88c..a6a8ca6318 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -229,15 +229,16 @@ def srctree_hash_files(d, srcdir=None):
229 env['GIT_INDEX_FILE'] = tmp_index.name 229 env['GIT_INDEX_FILE'] = tmp_index.name
230 subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env) 230 subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env)
231 git_sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8") 231 git_sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8")
232 submodule_helper = subprocess.check_output(['git', 'submodule--helper', 'list'], cwd=s_dir, env=env).decode("utf-8") 232 if os.path.exists(".gitmodules"):
233 for line in submodule_helper.splitlines(): 233 submodule_helper = subprocess.check_output(["git", "config", "--file", ".gitmodules", "--get-regexp", "path"], cwd=s_dir, env=env).decode("utf-8")
234 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) 234 for line in submodule_helper.splitlines():
235 if os.path.isdir(module_dir): 235 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1])
236 proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 236 if os.path.isdir(module_dir):
237 proc.communicate() 237 proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
238 proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) 238 proc.communicate()
239 stdout, _ = proc.communicate() 239 proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
240 git_sha1 += stdout.decode("utf-8") 240 stdout, _ = proc.communicate()
241 git_sha1 += stdout.decode("utf-8")
241 sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest() 242 sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest()
242 with open(oe_hash_file, 'w') as fobj: 243 with open(oe_hash_file, 'w') as fobj:
243 fobj.write(sha1) 244 fobj.write(sha1)