Run install-build-deps in the middle of 'fetch chromium'
R=mmoss@chromium.org
BUG=229270
Review URL: https://codereview.chromium.org/1187913002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295679 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/fetch.py b/fetch.py
index 067d4c6..03ba986 100755
--- a/fetch.py
+++ b/fetch.py
@@ -62,7 +62,7 @@
def run(self, cmd, **kwargs):
print 'Running: %s' % (' '.join(pipes.quote(x) for x in cmd))
if self.options.dry_run:
- return 0
+ return ''
return subprocess.check_output(cmd, **kwargs)
@@ -133,7 +133,7 @@
# Configure and do the gclient checkout.
self.run_gclient('config', '--spec', self._format_spec())
sync_cmd = ['sync']
- if self.options.nohooks:
+ if self.options.nohooks or self.spec.get('fetch_hooks'):
sync_cmd.append('--nohooks')
if self.options.no_history:
sync_cmd.append('--no-history')
@@ -141,6 +141,11 @@
sync_cmd.append('--with_branch_heads')
self.run_gclient(*sync_cmd)
+ for cmd in self.spec.get('fetch_hooks', []):
+ self.run(cmd)
+ if self.spec.get('fetch_hooks') and not self.options.nohooks:
+ self.run_gclient('runhooks')
+
# Configure git.
wd = os.path.join(self.base, self.root)
if self.options.dry_run:
diff --git a/recipes/chromium.py b/recipes/chromium.py
index 6416ee0..ccadd1f 100644
--- a/recipes/chromium.py
+++ b/recipes/chromium.py
@@ -31,6 +31,8 @@
spec['target_os'] = props['target_os'].split(',')
if props.get('target_os_only'):
spec['target_os_only'] = props['target_os_only']
+ install_build_deps = ['src/build/install-build-deps.sh']
+ spec['fetch_hooks'] = [install_build_deps]
return {
'type': 'gclient_git',
'gclient_git_spec': spec,