diff options
Diffstat (limited to 'meta/classes/externalsrc.bbclass')
| -rw-r--r-- | meta/classes/externalsrc.bbclass | 19 |
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) |
