bootstrap.py: Filter instead of iteration
This commit is contained in:
parent
1fea55ba51
commit
5bcf06aa18
1 changed files with 8 additions and 9 deletions
|
@ -565,15 +565,14 @@ class RustBuild(object):
|
||||||
submodules = [s.split()[1] for s in subprocess.check_output(
|
submodules = [s.split()[1] for s in subprocess.check_output(
|
||||||
["git", "config", "--file", os.path.join(
|
["git", "config", "--file", os.path.join(
|
||||||
self.rust_root, ".gitmodules"), "--get-regexp", "path"]).splitlines()]
|
self.rust_root, ".gitmodules"), "--get-regexp", "path"]).splitlines()]
|
||||||
for module in submodules:
|
submodules = [module for module in submodules
|
||||||
if module.endswith(b"llvm") and \
|
if not ((module.endswith(b"llvm") and
|
||||||
(self.get_toml('llvm-config') or self.get_mk('CFG_LLVM_ROOT')):
|
(self.get_toml('llvm-config') or self.get_mk('CFG_LLVM_ROOT'))) or
|
||||||
continue
|
(module.endswith(b"jemalloc") and
|
||||||
if module.endswith(b"jemalloc") and \
|
(self.get_toml('jemalloc') or self.get_mk('CFG_JEMALLOC_ROOT'))))
|
||||||
(self.get_toml('jemalloc') or self.get_mk('CFG_JEMALLOC_ROOT')):
|
]
|
||||||
continue
|
run(["git", "submodule", "update",
|
||||||
run(["git", "submodule", "update",
|
"--init"] + submodules, cwd=self.rust_root)
|
||||||
"--init", module], cwd=self.rust_root)
|
|
||||||
run(["git", "submodule", "-q", "foreach", "git",
|
run(["git", "submodule", "-q", "foreach", "git",
|
||||||
"reset", "-q", "--hard"], cwd=self.rust_root)
|
"reset", "-q", "--hard"], 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