| 74 | return True |
| 75 | |
| 76 | def FetchDeps(v8_path): |
| 77 | # Verify path. |
| 78 | v8_path = os.path.abspath(v8_path) |
| 79 | assert os.path.isdir(v8_path) |
| 80 | |
| 81 | # Check out depot_tools if necessary. |
| 82 | depot_tools = node_common.EnsureDepotTools(v8_path, True) |
| 83 | |
| 84 | temporary_git = EnsureGit(v8_path) |
| 85 | try: |
| 86 | print("Fetching dependencies.") |
| 87 | env = os.environ.copy() |
| 88 | # gclient needs to have depot_tools in the PATH. |
| 89 | env["PATH"] = depot_tools + os.pathsep + env["PATH"] |
| 90 | gclient = os.path.join(depot_tools, "gclient.py") |
| 91 | spec = "solutions = %s" % GCLIENT_SOLUTION |
| 92 | subprocess.check_call([sys.executable, gclient, "sync", "--spec", spec], |
| 93 | cwd=os.path.join(v8_path, os.path.pardir), |
| 94 | env=env) |
| 95 | except: |
| 96 | raise |
| 97 | finally: |
| 98 | if temporary_git: |
| 99 | node_common.UninitGit(v8_path) |
| 100 | # Clean up .gclient_entries file. |
| 101 | gclient_entries = os.path.normpath( |
| 102 | os.path.join(v8_path, os.pardir, ".gclient_entries")) |
| 103 | if os.path.isfile(gclient_entries): |
| 104 | os.remove(gclient_entries) |
| 105 | |
| 106 | return depot_tools |
| 107 | |
| 108 | |
| 109 | if __name__ == "__main__": |