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

Side by Side Diff: gclient.py

Issue 150633004: Warn if --gclientfile= specifies a with separators. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Fixed indentation. Created 6 years, 10 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
« 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 # Files 7 # Files
8 # .gclient : Current client configuration, written by 'config' command. 8 # .gclient : Current client configuration, written by 'config' command.
9 # Format is a Python script defining 'solutions', a list whose 9 # Format is a Python script defining 'solutions', a list whose
10 # entries each are maps binding the strings "name" and "url" 10 # entries each are maps binding the strings "name" and "url"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 # { "pattern": ".", 53 # { "pattern": ".",
54 # "name": "gyp", 54 # "name": "gyp",
55 # "action": ["python", "src/build/gyp_chromium"]}, 55 # "action": ["python", "src/build/gyp_chromium"]},
56 # ] 56 # ]
57 # 57 #
58 # Pre-DEPS Hooks 58 # Pre-DEPS Hooks
59 # DEPS files may optionally contain a list named "pre_deps_hooks". These are 59 # DEPS files may optionally contain a list named "pre_deps_hooks". These are
60 # the same as normal hooks, except that they run before the DEPS are 60 # the same as normal hooks, except that they run before the DEPS are
61 # processed. Pre-DEPS run with "sync" and "revert" unless the --noprehooks 61 # processed. Pre-DEPS run with "sync" and "revert" unless the --noprehooks
62 # flag is used. 62 # flag is used.
63 # 63 #
64 # Specifying a target OS 64 # Specifying a target OS
65 # An optional key named "target_os" may be added to a gclient file to specify 65 # An optional key named "target_os" may be added to a gclient file to specify
66 # one or more additional operating systems that should be considered when 66 # one or more additional operating systems that should be considered when
67 # processing the deps_os dict of a DEPS file. 67 # processing the deps_os dict of a DEPS file.
68 # 68 #
69 # Example: 69 # Example:
70 # target_os = [ "android" ] 70 # target_os = [ "android" ]
71 # 71 #
72 # If the "target_os_only" key is also present and true, then *only* the 72 # If the "target_os_only" key is also present and true, then *only* the
73 # operating systems listed in "target_os" will be used. 73 # operating systems listed in "target_os" will be used.
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 1853
1854 def parse_args(self, args=None, values=None): 1854 def parse_args(self, args=None, values=None):
1855 """Integrates standard options processing.""" 1855 """Integrates standard options processing."""
1856 options, args = optparse.OptionParser.parse_args(self, args, values) 1856 options, args = optparse.OptionParser.parse_args(self, args, values)
1857 levels = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG] 1857 levels = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG]
1858 logging.basicConfig( 1858 logging.basicConfig(
1859 level=levels[min(options.verbose, len(levels) - 1)], 1859 level=levels[min(options.verbose, len(levels) - 1)],
1860 format='%(module)s(%(lineno)d) %(funcName)s:%(message)s') 1860 format='%(module)s(%(lineno)d) %(funcName)s:%(message)s')
1861 if options.config_filename and options.spec: 1861 if options.config_filename and options.spec:
1862 self.error('Cannot specifiy both --gclientfile and --spec') 1862 self.error('Cannot specifiy both --gclientfile and --spec')
1863 if (options.config_filename and
1864 options.config_filename != os.path.basename(options.config_filename)):
1865 self.error('--gclientfile target must be a filename, not a path')
1863 if not options.config_filename: 1866 if not options.config_filename:
1864 options.config_filename = self.gclientfile_default 1867 options.config_filename = self.gclientfile_default
1865 options.entries_filename = options.config_filename + '_entries' 1868 options.entries_filename = options.config_filename + '_entries'
1866 if options.jobs < 1: 1869 if options.jobs < 1:
1867 self.error('--jobs must be 1 or higher') 1870 self.error('--jobs must be 1 or higher')
1868 1871
1869 # These hacks need to die. 1872 # These hacks need to die.
1870 if not hasattr(options, 'revisions'): 1873 if not hasattr(options, 'revisions'):
1871 # GClient.RunOnDeps expects it even if not applicable. 1874 # GClient.RunOnDeps expects it even if not applicable.
1872 options.revisions = [] 1875 options.revisions = []
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 raise 1919 raise
1917 except (gclient_utils.Error, subprocess2.CalledProcessError), e: 1920 except (gclient_utils.Error, subprocess2.CalledProcessError), e:
1918 print >> sys.stderr, 'Error: %s' % str(e) 1921 print >> sys.stderr, 'Error: %s' % str(e)
1919 return 1 1922 return 1
1920 1923
1921 1924
1922 if '__main__' == __name__: 1925 if '__main__' == __name__:
1923 sys.exit(Main(sys.argv[1:])) 1926 sys.exit(Main(sys.argv[1:]))
1924 1927
1925 # vim: ts=2:sw=2:tw=80:et: 1928 # 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