Use --gclientfile instead of --spec, because windows is THE WORST.

--spec contains newlines, which are interpreted as actual newlines in the
command line, which causes gclient to fall apart at the seams.

TBR=agable@chromium.org, kjellander@webrtc.org, szager@chromium.org
BUG=2863, chromium:339647

Review URL: https://webrtc-codereview.appspot.com/22429004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6944 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
iannucci@chromium.org 2014-08-21 02:14:11 +00:00
parent 98d92d63e2
commit 286210d3ec
2 changed files with 11 additions and 7 deletions

1
.gitignore vendored
View File

@ -37,6 +37,7 @@
/Makefile
/build
/buildtools
/chromium/.gclient.bot
/chromium/.gclient_entries
/chromium/.last_sync_chromium
/chromium/src

View File

@ -60,19 +60,22 @@ def main():
args.append('-vvv')
if sys.platform.startswith('win'):
cache_path = os.path.join(os.path.splitdrive(ROOT_DIR)[0],
cache_path = os.path.join(os.path.splitdrive(ROOT_DIR)[0] + os.path.sep,
'b', 'git-cache')
else:
cache_path = '/b/git-cache'
with open(os.path.join(opts.chromium_dir, '.gclient'), 'rb') as spec:
gclientfile = os.path.join(opts.chromium_dir, '.gclient')
with open(gclientfile, 'rb') as spec:
spec = spec.read().splitlines()
spec[-1] = 'cache_dir = %r' % (cache_path,)
args.append('--spec')
args.append('\n'.join(spec))
args.append('--delete_unversioned_trees')
args.append('--reset')
args.append('--upstream')
with open(gclientfile + '.bot', 'wb') as f:
f.write('\n'.join(spec))
args += [
'--gclientfile', '.gclient.bot',
'--delete_unversioned_trees', '--reset', '--upstream'
]
else:
args.append('--no-history')