| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """ | 6 """ |
| 7 Tool to perform checkouts in one easy command line! | 7 Tool to perform checkouts in one easy command line! |
| 8 | 8 |
| 9 Usage: | 9 Usage: |
| 10 fetch <recipe> [--property=value [--property2=value2 ...]] | 10 fetch <recipe> [--property=value [--property2=value2 ...]] |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 def exists(self): | 108 def exists(self): |
| 109 return os.path.exists(os.path.join(os.getcwd(), self.root)) | 109 return os.path.exists(os.path.join(os.getcwd(), self.root)) |
| 110 | 110 |
| 111 def init(self): | 111 def init(self): |
| 112 # TODO(dpranke): Work around issues w/ delta compression on big repos. | 112 # TODO(dpranke): Work around issues w/ delta compression on big repos. |
| 113 self.run_git('config', '--global', 'core.deltaBaseCacheLimit', '1G') | 113 self.run_git('config', '--global', 'core.deltaBaseCacheLimit', '1G') |
| 114 | 114 |
| 115 # Configure and do the gclient checkout. | 115 # Configure and do the gclient checkout. |
| 116 self.run_gclient('config', '--spec', self.spec['gclient_spec']) | 116 self.run_gclient('config', '--spec', self.spec['gclient_spec']) |
| 117 self.run_gclient('sync') | 117 self.run_gclient('sync', '--nohooks') |
| 118 | 118 |
| 119 # Configure git. | |
| 120 wd = os.path.join(self.base, self.root) | 119 wd = os.path.join(self.base, self.root) |
| 121 if self.dryrun: | 120 if self.dryrun: |
| 122 print 'cd %s' % wd | 121 print 'cd %s' % wd |
| 122 |
| 123 if sys.platform.startswith('linux'): |
| 124 self.run(('build/install-build-deps.sh',), cwd=wd) |
| 125 |
| 126 self.run_gclient('runhooks') |
| 127 |
| 128 # Configure git. |
| 123 self.run_git( | 129 self.run_git( |
| 124 'submodule', 'foreach', | 130 'submodule', 'foreach', |
| 125 'git config -f $toplevel/.git/config submodule.$name.ignore all', | 131 'git config -f $toplevel/.git/config submodule.$name.ignore all', |
| 126 cwd=wd) | 132 cwd=wd) |
| 127 self.run_git('config', 'diff.ignoreSubmodules', 'all', cwd=wd) | 133 self.run_git('config', 'diff.ignoreSubmodules', 'all', cwd=wd) |
| 128 | 134 |
| 129 | 135 |
| 130 class GclientGitSvnCheckout(GclientGitCheckout, SvnCheckout): | 136 class GclientGitSvnCheckout(GclientGitCheckout, SvnCheckout): |
| 131 | 137 |
| 132 def __init__(self, dryrun, spec, root): | 138 def __init__(self, dryrun, spec, root): |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 275 |
| 270 | 276 |
| 271 def main(): | 277 def main(): |
| 272 dryrun, recipe, props = handle_args(sys.argv) | 278 dryrun, recipe, props = handle_args(sys.argv) |
| 273 spec, root = run_recipe_fetch(recipe, props) | 279 spec, root = run_recipe_fetch(recipe, props) |
| 274 return run(dryrun, spec, root) | 280 return run(dryrun, spec, root) |
| 275 | 281 |
| 276 | 282 |
| 277 if __name__ == '__main__': | 283 if __name__ == '__main__': |
| 278 sys.exit(main()) | 284 sys.exit(main()) |
| OLD | NEW |