bootstrap.py: decode to str
Also, improve the split mechanism to address space in paths.
This commit is contained in:
parent
5bcf06aa18
commit
46ebd832e3
1 changed files with 10 additions and 11 deletions
|
@ -557,20 +557,19 @@ class RustBuild(object):
|
||||||
self.get_toml('submodules') == "false" or \
|
self.get_toml('submodules') == "false" or \
|
||||||
self.get_mk('CFG_DISABLE_MANAGE_SUBMODULES') == "1":
|
self.get_mk('CFG_DISABLE_MANAGE_SUBMODULES') == "1":
|
||||||
return
|
return
|
||||||
|
|
||||||
print('Updating submodules')
|
print('Updating submodules')
|
||||||
|
default_encoding = sys.getdefaultencoding()
|
||||||
run(["git", "submodule", "-q", "sync"], cwd=self.rust_root)
|
run(["git", "submodule", "-q", "sync"], cwd=self.rust_root)
|
||||||
# FIXME: nobody does, but this won't work well with whitespace in
|
submodules = [s.split(' ', 1)[1] for s in subprocess.check_output(
|
||||||
# submodule path
|
["git", "config", "--file", os.path.join(self.rust_root, ".gitmodules"),
|
||||||
submodules = [s.split()[1] for s in subprocess.check_output(
|
"--get-regexp", "path"]
|
||||||
["git", "config", "--file", os.path.join(
|
).decode(default_encoding).splitlines()]
|
||||||
self.rust_root, ".gitmodules"), "--get-regexp", "path"]).splitlines()]
|
|
||||||
submodules = [module for module in submodules
|
submodules = [module for module in submodules
|
||||||
if not ((module.endswith(b"llvm") and
|
if not ((module.endswith("llvm") and
|
||||||
(self.get_toml('llvm-config') or self.get_mk('CFG_LLVM_ROOT'))) or
|
(self.get_toml('llvm-config') or self.get_mk('CFG_LLVM_ROOT'))) or
|
||||||
(module.endswith(b"jemalloc") and
|
(module.endswith("jemalloc") and
|
||||||
(self.get_toml('jemalloc') or self.get_mk('CFG_JEMALLOC_ROOT'))))
|
(self.get_toml('jemalloc') or self.get_mk('CFG_JEMALLOC_ROOT'))))
|
||||||
]
|
]
|
||||||
run(["git", "submodule", "update",
|
run(["git", "submodule", "update",
|
||||||
"--init"] + submodules, cwd=self.rust_root)
|
"--init"] + submodules, cwd=self.rust_root)
|
||||||
run(["git", "submodule", "-q", "foreach", "git",
|
run(["git", "submodule", "-q", "foreach", "git",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue