Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: gclient.py

Issue 17438005: Prints a hash of the boto file if gclient sync is run from a bot (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env 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 """Meta checkout manager supporting both Subversion and GIT. 6 """Meta checkout manager supporting both Subversion and GIT.
7 7
8 Files 8 Files
9 .gclient : Current client configuration, written by 'config' command. 9 .gclient : Current client configuration, written by 'config' command.
10 Format is a Python script defining 'solutions', a list whose 10 Format is a Python script defining 'solutions', a list whose
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 operating systems listed in "target_os" will be used. 60 operating systems listed in "target_os" will be used.
61 61
62 Example: 62 Example:
63 target_os = [ "ios" ] 63 target_os = [ "ios" ]
64 target_os_only = True 64 target_os_only = True
65 """ 65 """
66 66
67 __version__ = "0.6.4" 67 __version__ = "0.6.4"
68 68
69 import copy 69 import copy
70 import hashlib
70 import logging 71 import logging
71 import optparse 72 import optparse
72 import os 73 import os
73 import platform 74 import platform
74 import posixpath 75 import posixpath
75 import pprint 76 import pprint
76 import re 77 import re
77 import sys 78 import sys
78 import urllib 79 import urllib
79 import urlparse 80 import urlparse
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', 1538 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST',
1538 help='override deps for the specified (comma-separated) ' 1539 help='override deps for the specified (comma-separated) '
1539 'platform(s); \'all\' will process all deps_os ' 1540 'platform(s); \'all\' will process all deps_os '
1540 'references') 1541 'references')
1541 parser.add_option('-m', '--manually_grab_svn_rev', action='store_true', 1542 parser.add_option('-m', '--manually_grab_svn_rev', action='store_true',
1542 help='Skip svn up whenever possible by requesting ' 1543 help='Skip svn up whenever possible by requesting '
1543 'actual HEAD revision from the repository') 1544 'actual HEAD revision from the repository')
1544 (options, args) = parser.parse_args(args) 1545 (options, args) = parser.parse_args(args)
1545 client = GClient.LoadCurrentConfig(options) 1546 client = GClient.LoadCurrentConfig(options)
1546 1547
1548 # Print some extra info if we are running on a bot.
1549 if 'CHROME_HEADLESS' in os.environ and os.environ['CHROME_HEADLESS'] == '1':
1550 if 'AWS_CREDENTIAL_FILE' in os.environ:
1551 boto_location = os.environ['AWS_CREDENTIAL_FILE']
1552 else:
1553 boto_location = os.path.expanduser('~/.boto')
1554 if os.path.exists(boto_location):
1555 with open(boto_location) as f:
1556 boto_hash = hashlib.sha1(f.read()).hexdigest()
1557 else:
1558 boto_hash = 'None'
1559 print '===Bot Info==='
1560 print 'Boto hash: %s' % boto_hash
1561 print '===End Bot Info==='
1562
1547 if not client: 1563 if not client:
1548 raise gclient_utils.Error('client not configured; see \'gclient config\'') 1564 raise gclient_utils.Error('client not configured; see \'gclient config\'')
1549 1565
1550 if options.revisions and options.head: 1566 if options.revisions and options.head:
1551 # TODO(maruel): Make it a parser.error if it doesn't break any builder. 1567 # TODO(maruel): Make it a parser.error if it doesn't break any builder.
1552 print('Warning: you cannot use both --head and --revision') 1568 print('Warning: you cannot use both --head and --revision')
1553 1569
1554 if options.verbose: 1570 if options.verbose:
1555 # Print out the .gclient file. This is longer than if we just printed the 1571 # Print out the .gclient file. This is longer than if we just printed the
1556 # client dict, but more legible, and it might contain helpful comments. 1572 # client dict, but more legible, and it might contain helpful comments.
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1799 except (gclient_utils.Error, subprocess2.CalledProcessError), e: 1815 except (gclient_utils.Error, subprocess2.CalledProcessError), e:
1800 print >> sys.stderr, 'Error: %s' % str(e) 1816 print >> sys.stderr, 'Error: %s' % str(e)
1801 return 1 1817 return 1
1802 1818
1803 1819
1804 if '__main__' == __name__: 1820 if '__main__' == __name__:
1805 fix_encoding.fix_encoding() 1821 fix_encoding.fix_encoding()
1806 sys.exit(Main(sys.argv[1:])) 1822 sys.exit(Main(sys.argv[1:]))
1807 1823
1808 # vim: ts=2:sw=2:tw=80:et: 1824 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698