2 Pull a specified revision of chromium from SVN.
4 Usage: python pull-chromium.py <topsrcdir> <chromiumtree> <revision>
6 You will have to set up a Chromium tree before running this step. See
7 http://dev.chromium.org/developers/how-tos/get-the-code for details about
8 doing this efficiently.
12 from subprocess
import check_call
13 from shutil
import rmtree
15 topsrcdir
, chromiumtree
, rev
= sys
.argv
[1:]
17 if not os
.path
.exists(os
.path
.join(topsrcdir
, 'client.py')):
18 print >>sys
.stderr
, "Incorrect topsrcdir"
21 if not os
.path
.exists(os
.path
.join(chromiumtree
, 'src/DEPS')):
22 print >>sys
.stderr
, "Incorrect chromium directory, missing DEPS"
25 check_call(['gclient', 'sync', '--force', '--revision=src@%s' % rev
], cwd
=chromiumtree
)
27 chromiumsrc
= os
.path
.join(topsrcdir
, 'ipc/chromium/src')
28 os
.path
.exists(chromiumsrc
) and rmtree(chromiumsrc
)
30 def doexport(svnpath
):
31 localpath
= os
.path
.join(chromiumsrc
, svnpath
)
32 os
.makedirs(os
.path
.dirname(localpath
))
33 check_call(['svn', 'export', '-r', 'BASE', os
.path
.join(chromiumtree
, 'src', svnpath
), localpath
])
36 doexport('chrome/common')
37 doexport('build/build_config.h')
38 doexport('testing/gtest/include')
39 doexport('third_party/libevent')