| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """ Set of basic operations/utilities that are used by the build. """ | 5 """ Set of basic operations/utilities that are used by the build. """ |
| 6 | 6 |
| 7 from contextlib import contextmanager | 7 from contextlib import contextmanager |
| 8 import ast | 8 import ast |
| 9 import base64 | 9 import base64 |
| 10 import cStringIO | 10 import cStringIO |
| (...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 # scons build cruft | 1892 # scons build cruft |
| 1893 '.sconsign.dblite', | 1893 '.sconsign.dblite', |
| 1894 # build helper, not needed on testers | 1894 # build helper, not needed on testers |
| 1895 'mksnapshot', | 1895 'mksnapshot', |
| 1896 ] | 1896 ] |
| 1897 | 1897 |
| 1898 return all_platforms | 1898 return all_platforms |
| 1899 | 1899 |
| 1900 | 1900 |
| 1901 def DatabaseSetup(buildmaster_config, require_dbconfig=False): | 1901 def DatabaseSetup(buildmaster_config, require_dbconfig=False): |
| 1902 """Read database credentials in the master directory.""" | 1902 """Configure the database settings for the buildbot master.""" |
| 1903 |
| 1904 # By default nothing is ever deleted from the database. We set a |
| 1905 # changeHorizon here to put an upper bound on the database size. |
| 1906 if 'changeHorizon' not in buildmaster_config: |
| 1907 buildmaster_config['changeHorizon'] = 3000 |
| 1908 |
| 1909 # Read database credentials in the master directory. |
| 1903 if os.path.isfile('.dbconfig'): | 1910 if os.path.isfile('.dbconfig'): |
| 1904 values = {} | 1911 values = {} |
| 1905 execfile('.dbconfig', values) | 1912 execfile('.dbconfig', values) |
| 1906 if 'password' not in values: | 1913 if 'password' not in values: |
| 1907 raise Exception('could not get db password') | 1914 raise Exception('could not get db password') |
| 1908 | 1915 |
| 1909 buildmaster_config['db_url'] = 'postgresql://%s:%s@%s/%s' % ( | 1916 buildmaster_config['db_url'] = 'postgresql://%s:%s@%s/%s' % ( |
| 1910 values['username'], values['password'], | 1917 values['username'], values['password'], |
| 1911 values.get('hostname', 'localhost'), values['dbname']) | 1918 values.get('hostname', 'localhost'), values['dbname']) |
| 1912 else: | 1919 else: |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2032 return False | 2039 return False |
| 2033 # Matches e.g. "cl_x86 = path/to/clang-cl.exe" | 2040 # Matches e.g. "cl_x86 = path/to/clang-cl.exe" |
| 2034 clang_cl_re = re.compile( | 2041 clang_cl_re = re.compile( |
| 2035 r'^cl_x\d\d\s+\=\s+(?P<compiler_path>[^ ]+)\s.*$', | 2042 r'^cl_x\d\d\s+\=\s+(?P<compiler_path>[^ ]+)\s.*$', |
| 2036 re.VERBOSE) | 2043 re.VERBOSE) |
| 2037 for line in open(build_file): | 2044 for line in open(build_file): |
| 2038 m = clang_cl_re.match(line) | 2045 m = clang_cl_re.match(line) |
| 2039 if m: | 2046 if m: |
| 2040 return 'clang' in m.group('compiler_path') | 2047 return 'clang' in m.group('compiler_path') |
| 2041 return False | 2048 return False |
| OLD | NEW |