| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 """Prepares a local hermetic Go installation. | 6 """Prepares a local hermetic Go installation. |
| 7 | 7 |
| 8 - Downloads and unpacks the Go toolset in ../../golang. | 8 - Downloads and unpacks the Go toolset in ../../golang. |
| 9 - Downloads and installs Glide (used by deps.py). | 9 - Downloads and installs Glide (used by deps.py). |
| 10 - Fetches code dependencies via deps.py. | 10 - Fetches code dependencies via deps.py. |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 # APPENGINE_DEV_APPSERVER is used by "appengine/aetest" package. If it's | 387 # APPENGINE_DEV_APPSERVER is used by "appengine/aetest" package. If it's |
| 388 # missing, aetest will scan PATH looking for dev_appserver.py, possibly | 388 # missing, aetest will scan PATH looking for dev_appserver.py, possibly |
| 389 # finding it in some other place. | 389 # finding it in some other place. |
| 390 if go_appengine_path: | 390 if go_appengine_path: |
| 391 env['APPENGINE_DEV_APPSERVER'] = os.path.join( | 391 env['APPENGINE_DEV_APPSERVER'] = os.path.join( |
| 392 go_appengine_path, 'dev_appserver.py') | 392 go_appengine_path, 'dev_appserver.py') |
| 393 else: | 393 else: |
| 394 env.pop('APPENGINE_DEV_APPSERVER', None) | 394 env.pop('APPENGINE_DEV_APPSERVER', None) |
| 395 | 395 |
| 396 # Add a tag to the prompt | 396 # Add a tag to the prompt |
| 397 prompt = env.get('PS1') | 397 infra_prompt_tag = env.get('INFRA_PROMPT_TAG') |
| 398 if prompt: | 398 if infra_prompt_tag: |
| 399 prompttag = env.get('INFRA_PROMPT_TAG', '[cr go] ') | 399 prompt = env.get('PS1') |
| 400 if prompttag not in prompt: | 400 if prompt and infra_prompt_tag not in prompt: |
| 401 env['PS1'] = prompttag + prompt | 401 env['PS1'] = infra_prompt_tag + prompt |
| 402 | 402 |
| 403 return env | 403 return env |
| 404 | 404 |
| 405 | 405 |
| 406 def get_go_exe(toolset_root): | 406 def get_go_exe(toolset_root): |
| 407 """Returns path to go executable.""" | 407 """Returns path to go executable.""" |
| 408 return os.path.join(toolset_root, 'go', 'bin', 'go' + EXE_SFX) | 408 return os.path.join(toolset_root, 'go', 'bin', 'go' + EXE_SFX) |
| 409 | 409 |
| 410 | 410 |
| 411 def bootstrap(go_paths, logging_level): | 411 def bootstrap(go_paths, logging_level): |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 return name | 478 return name |
| 479 | 479 |
| 480 | 480 |
| 481 def main(): | 481 def main(): |
| 482 bootstrap([WORKSPACE], logging.DEBUG) | 482 bootstrap([WORKSPACE], logging.DEBUG) |
| 483 return 0 | 483 return 0 |
| 484 | 484 |
| 485 | 485 |
| 486 if __name__ == '__main__': | 486 if __name__ == '__main__': |
| 487 sys.exit(main()) | 487 sys.exit(main()) |
| OLD | NEW |