Index: gclient.py |
diff --git a/gclient.py b/gclient.py |
index 8d67b5a9eb1a3c4cc5d88ce297e9b32bd7390065..9f0f8c1d957c5ce8320b53bd6368eb5618ba2752 100755 |
--- a/gclient.py |
+++ b/gclient.py |
@@ -535,14 +535,24 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): |
deps_content = None |
use_strict = False |
- filepath = os.path.join(self.root.root_dir, self.name, self.deps_file) |
- if not os.path.isfile(filepath): |
+ |
+ # First try to locate the configured deps file. If it's missing, fallback |
+ # to DEPS. |
+ deps_files = set([self.deps_file, 'DEPS']) |
agable
2014/07/01 22:17:46
could just be deps_file = {self.deps_file, 'DEPS'}
iannucci
2014/07/01 22:21:40
Nooooo!!! sets are not ordered!
deps_files = [sel
|
+ for deps_file in deps_files: |
+ filepath = os.path.join(self.root.root_dir, self.name, deps_file) |
+ if os.path.isfile(filepath): |
+ logging.info( |
+ 'ParseDepsFile(%s): %s file found at %s', |
+ self.name, deps_file, filepath) |
+ break |
logging.info( |
- 'ParseDepsFile(%s): No %s file found at %s' % ( |
- self.name, self.deps_file, filepath)) |
- else: |
+ 'ParseDepsFile(%s): No %s file found at %s', |
+ self.name, deps_file, filepath) |
agable
2014/07/01 22:17:46
nit: outdent 2.
|
+ |
+ if os.path.isfile(filepath): |
deps_content = gclient_utils.FileRead(filepath) |
- logging.debug('ParseDepsFile(%s) read:\n%s' % (self.name, deps_content)) |
+ logging.debug('ParseDepsFile(%s) read:\n%s', self.name, deps_content) |
use_strict = 'use strict' in deps_content.splitlines()[0] |
local_scope = {} |