OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Diagnose some common system configuration problems on Linux, and | 6 """Diagnose some common system configuration problems on Linux, and |
7 suggest fixes.""" | 7 suggest fixes.""" |
8 | 8 |
9 import os | 9 import os |
10 import subprocess | 10 import subprocess |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 proc = subprocess.Popen(['which', 'ninja'], stdout=subprocess.PIPE) | 72 proc = subprocess.Popen(['which', 'ninja'], stdout=subprocess.PIPE) |
73 stdout = proc.communicate()[0] | 73 stdout = proc.communicate()[0] |
74 if not 'depot_tools' in stdout: | 74 if not 'depot_tools' in stdout: |
75 return ("The ninja binary in your path isn't from depot_tools:\n" | 75 return ("The ninja binary in your path isn't from depot_tools:\n" |
76 + " " + stdout + | 76 + " " + stdout + |
77 "Remove custom ninjas from your path so that the one\n" | 77 "Remove custom ninjas from your path so that the one\n" |
78 "in depot_tools is used.\n") | 78 "in depot_tools is used.\n") |
79 return None | 79 return None |
80 | 80 |
81 | 81 |
| 82 @Check("build dependencies are satisfied") |
| 83 def CheckBuildDeps(): |
| 84 script_path = os.path.join( |
| 85 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'build', |
| 86 'install-build-deps.sh') |
| 87 proc = subprocess.Popen([script_path, '--quick-check'], |
| 88 stdout=subprocess.PIPE) |
| 89 stdout = proc.communicate()[0] |
| 90 if 'WARNING' in stdout: |
| 91 return ("Your build dependencies are out-of-date.\n" |
| 92 "Run '" + script_path + "' to update.") |
| 93 return None |
| 94 |
| 95 |
82 def RunChecks(): | 96 def RunChecks(): |
83 for name, check in all_checks: | 97 for name, check in all_checks: |
84 sys.stdout.write("* Checking %s: " % name) | 98 sys.stdout.write("* Checking %s: " % name) |
85 sys.stdout.flush() | 99 sys.stdout.flush() |
86 error = check() | 100 error = check() |
87 if not error: | 101 if not error: |
88 print "ok" | 102 print "ok" |
89 else: | 103 else: |
90 print "FAIL" | 104 print "FAIL" |
91 print error | 105 print error |
92 | 106 |
93 | 107 |
94 if __name__ == '__main__': | 108 if __name__ == '__main__': |
95 RunChecks() | 109 RunChecks() |
OLD | NEW |