diff options
| -rw-r--r-- | meta/classes/externalsrc.bbclass | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index 259ccbc79f..1d7300d65b 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass | |||
| @@ -190,6 +190,7 @@ def srctree_hash_files(d, srcdir=None): | |||
| 190 | import shutil | 190 | import shutil |
| 191 | import subprocess | 191 | import subprocess |
| 192 | import tempfile | 192 | import tempfile |
| 193 | import hashlib | ||
| 193 | 194 | ||
| 194 | s_dir = srcdir or d.getVar('EXTERNALSRC') | 195 | s_dir = srcdir or d.getVar('EXTERNALSRC') |
| 195 | git_dir = None | 196 | git_dir = None |
| @@ -214,7 +215,16 @@ def srctree_hash_files(d, srcdir=None): | |||
| 214 | env = os.environ.copy() | 215 | env = os.environ.copy() |
| 215 | env['GIT_INDEX_FILE'] = tmp_index.name | 216 | env['GIT_INDEX_FILE'] = tmp_index.name |
| 216 | subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env) | 217 | subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env) |
| 217 | sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8") | 218 | git_sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8") |
| 219 | submodule_helper = subprocess.check_output(['git', 'submodule--helper', 'list'], cwd=s_dir, env=env).decode("utf-8") | ||
| 220 | for line in submodule_helper.splitlines(): | ||
| 221 | module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) | ||
| 222 | proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) | ||
| 223 | proc.communicate() | ||
| 224 | proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) | ||
| 225 | stdout, _ = proc.communicate() | ||
| 226 | git_sha1 += stdout.decode("utf-8") | ||
| 227 | sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest() | ||
| 218 | with open(oe_hash_file, 'w') as fobj: | 228 | with open(oe_hash_file, 'w') as fobj: |
| 219 | fobj.write(sha1) | 229 | fobj.write(sha1) |
| 220 | ret = oe_hash_file + ':True' | 230 | ret = oe_hash_file + ':True' |
