summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes-recipe/externalsrc.bbclass19
1 files changed, 10 insertions, 9 deletions
diff --git a/meta/classes-recipe/externalsrc.bbclass b/meta/classes-recipe/externalsrc.bbclass
index ce753fce76..06a9548a20 100644
--- a/meta/classes-recipe/externalsrc.bbclass
+++ b/meta/classes-recipe/externalsrc.bbclass
@@ -230,15 +230,16 @@ 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 submodule_helper = subprocess.check_output(['git', 'submodule--helper', 'list'], cwd=s_dir, env=env).decode("utf-8") 233 if os.path.exists(".gitmodules"):
234 for line in submodule_helper.splitlines(): 234 submodule_helper = subprocess.check_output(["git", "config", "--file", ".gitmodules", "--get-regexp", "path"], cwd=s_dir, env=env).decode("utf-8")
235 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) 235 for line in submodule_helper.splitlines():
236 if os.path.isdir(module_dir): 236 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1])
237 proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 237 if os.path.isdir(module_dir):
238 proc.communicate() 238 proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
239 proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) 239 proc.communicate()
240 stdout, _ = proc.communicate() 240 proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
241 git_sha1 += stdout.decode("utf-8") 241 stdout, _ = proc.communicate()
242 git_sha1 += stdout.decode("utf-8")
242 sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest() 243 sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest()
243 with open(oe_hash_file, 'w') as fobj: 244 with open(oe_hash_file, 'w') as fobj:
244 fobj.write(sha1) 245 fobj.write(sha1)