Skip to content

Commit

Permalink
bootstrap.py: decode to str
Browse files Browse the repository at this point in the history
Also, improve the split mechanism to address space in paths.
  • Loading branch information
ishitatsuyuki committed May 22, 2017
1 parent 8f111f3 commit d34aaa1
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,20 +560,19 @@ def update_submodules(self):
self.get_toml('submodules') == "false" or \
self.get_mk('CFG_DISABLE_MANAGE_SUBMODULES') == "1":
return

print('Updating submodules')
default_encoding = sys.getdefaultencoding()
self.run(["git", "submodule", "-q", "sync"], cwd=self.rust_root)
# FIXME: nobody does, but this won't work well with whitespace in
# submodule path
submodules = [s.split()[1] for s in subprocess.check_output(
["git", "config", "--file", os.path.join(
self.rust_root, ".gitmodules"), "--get-regexp", "path"]).splitlines()]
submodules = [s.split(' ', 1)[1] for s in subprocess.check_output(
["git", "config", "--file", os.path.join(self.rust_root, ".gitmodules"),
"--get-regexp", "path"]
).decode(default_encoding).splitlines()]
submodules = [module for module in submodules
if not ((module.endswith(b"llvm") and
(self.get_toml('llvm-config') or self.get_mk('CFG_LLVM_ROOT'))) or
(module.endswith(b"jemalloc") and
(self.get_toml('jemalloc') or self.get_mk('CFG_JEMALLOC_ROOT'))))
]
if not ((module.endswith("llvm") and
(self.get_toml('llvm-config') or self.get_mk('CFG_LLVM_ROOT'))) or
(module.endswith("jemalloc") and
(self.get_toml('jemalloc') or self.get_mk('CFG_JEMALLOC_ROOT'))))
]
self.run(["git", "submodule", "update",
"--init"] + submodules, cwd=self.rust_root)
self.run(["git", "submodule", "-q", "foreach", "git",
Expand Down

0 comments on commit d34aaa1

Please sign in to comment.