diff options
| author | Thomas Roos <throos@amazon.de> | 2023-01-16 15:30:22 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-04 23:32:20 +0000 |
| commit | cc82bf667c92d9e6004fbd4a5f36d85b033a9d4b (patch) | |
| tree | 283bb7a2d7f835f70f5e409cdd5b364cec589dec /meta/classes | |
| parent | aa042d4b2eb554f399705798faf3a019e497efc7 (diff) | |
| download | poky-cc82bf667c92d9e6004fbd4a5f36d85b033a9d4b.tar.gz | |
devtool: fix devtool finish when gitmodules file is empty
When a .gitmodules file exists but is empty then devtool finish fails.
Add an additional check for this.
[YOCTO #14999]
(From OE-Core rev: 3c3b16ed1c2e74389d570fba8800ffdec62fdd48)
Signed-off-by: Thomas Roos <throos@amazon.de>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b4f0f7c4934bade9e4d4a1086f9d8b29d8e9ad45)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/externalsrc.bbclass | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index 57135f2e4c..a649bcdff8 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass | |||
| @@ -229,7 +229,7 @@ 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 | if os.path.exists(os.path.join(s_dir, ".gitmodules")): | 232 | if os.path.exists(os.path.join(s_dir, ".gitmodules")) and os.path.getsize(os.path.join(s_dir, ".gitmodules")) > 0: |
| 233 | submodule_helper = subprocess.check_output(["git", "config", "--file", ".gitmodules", "--get-regexp", "path"], cwd=s_dir, env=env).decode("utf-8") | 233 | submodule_helper = subprocess.check_output(["git", "config", "--file", ".gitmodules", "--get-regexp", "path"], cwd=s_dir, env=env).decode("utf-8") |
| 234 | for line in submodule_helper.splitlines(): | 234 | for line in submodule_helper.splitlines(): |
| 235 | module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) | 235 | module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) |
