Chromium Code Reviews| Index: gclient.py |
| =================================================================== |
| --- gclient.py (revision 86867) |
| +++ gclient.py (working copy) |
| @@ -266,7 +266,8 @@ |
| } |
| filepath = os.path.join(self.root_dir(), self.name, self.deps_file) |
| if not os.path.isfile(filepath): |
| - logging.info('%s: No DEPS file found at %s' % (self.name, filepath)) |
| + logging.info('%s: No %s file found at %s' % (self.name, self.deps_file, |
| + filepath)) |
| else: |
| deps_content = gclient_utils.FileRead(filepath) |
| logging.debug(deps_content) |
| @@ -585,6 +586,7 @@ |
| solutions = [ |
| { "name" : "%(solution_name)s", |
| "url" : "%(solution_url)s", |
| + "deps_file" : "%(deps_file)s", |
| "custom_deps" : { |
| }, |
| "safesync_url": "%(safesync_url)s", |
| @@ -595,6 +597,7 @@ |
| DEFAULT_SNAPSHOT_SOLUTION_TEXT = ("""\ |
| { "name" : "%(solution_name)s", |
| "url" : "%(solution_url)s", |
| + "deps_file" : "%(deps_file)s", |
| "custom_deps" : { |
| %(solution_deps)s }, |
| "safesync_url": "%(safesync_url)s", |
| @@ -642,7 +645,7 @@ |
| s.get('safesync_url', None), |
| s.get('custom_deps', {}), |
| s.get('custom_vars', {}), |
| - None, |
| + s.get('deps_file', None), |
| True)) |
| except KeyError: |
| raise gclient_utils.Error('Invalid .gclient file. Solution is ' |
| @@ -668,10 +671,12 @@ |
| os.path.join(path, options.config_filename))) |
| return client |
| - def SetDefaultConfig(self, solution_name, solution_url, safesync_url): |
| + def SetDefaultConfig(self, solution_name, deps_file, solution_url, |
| + safesync_url): |
| self.SetConfig(self.DEFAULT_CLIENT_FILE_TEXT % { |
| 'solution_name': solution_name, |
| 'solution_url': solution_url, |
| + 'deps_file': deps_file, |
| 'safesync_url' : safesync_url, |
| }) |
| @@ -846,6 +851,7 @@ |
| new_gclient += self.DEFAULT_SNAPSHOT_SOLUTION_TEXT % { |
| 'solution_name': d.name, |
| 'solution_url': d.url, |
| + 'deps_file': d.deps_file, |
| 'safesync_url' : d.safesync_url or '', |
| 'solution_deps': ''.join(custom_deps), |
| } |
| @@ -964,6 +970,8 @@ |
| 'probably can\'t contain any newlines.') |
| parser.add_option('--name', |
| help='overrides the default name for the solution') |
| + parser.add_option('--deps-file', default='DEPS', |
| + help='overrides the default name for the DEPS file') |
|
cmp
2011/05/26 21:04:20
Can we add '--git-deps'? It would be a boolean fl
nsylvain
2011/05/26 21:13:28
Done.
|
| (options, args) = parser.parse_args(args) |
| if ((options.spec and args) or len(args) > 2 or |
| (not options.spec and not args)): |
| @@ -985,7 +993,7 @@ |
| safesync_url = '' |
| if len(args) > 1: |
| safesync_url = args[1] |
| - client.SetDefaultConfig(name, base_url, safesync_url) |
| + client.SetDefaultConfig(name, options.deps_file, base_url, safesync_url) |
| client.SaveConfig() |
| return 0 |