summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/externalsrc.bbclass16
1 files changed, 9 insertions, 7 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index c7b2bf2f49..54cc7edbae 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -217,14 +217,16 @@ def srctree_hash_files(d, srcdir=None):
217 env['GIT_INDEX_FILE'] = tmp_index.name 217 env['GIT_INDEX_FILE'] = tmp_index.name
218 subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env) 218 subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env)
219 git_sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8") 219 git_sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8")
220 submodule_helper = subprocess.check_output(['git', 'submodule--helper', 'list'], cwd=s_dir, env=env).decode("utf-8") 220 submodule_helper = subprocess.check_output(['git', 'submodule', 'status'], cwd=s_dir, env=env).decode("utf-8")
221 for line in submodule_helper.splitlines(): 221 for line in submodule_helper.splitlines():
222 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) 222 module_relpath = line.split()[1]
223 proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 223 if not module_relpath.split('/')[0] == '..':
224 proc.communicate() 224 module_dir = os.path.join(s_dir, module_relpath)
225 proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) 225 proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
226 stdout, _ = proc.communicate() 226 proc.communicate()
227 git_sha1 += stdout.decode("utf-8") 227 proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
228 stdout, _ = proc.communicate()
229 git_sha1 += stdout.decode("utf-8")
228 sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest() 230 sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest()
229 with open(oe_hash_file, 'w') as fobj: 231 with open(oe_hash_file, 'w') as fobj:
230 fobj.write(sha1) 232 fobj.write(sha1)