Bug 545320 - Port |Bug 482156 - Get rid of (unnecessary) LIBGNOME dependency| and...
[mozilla-central.git] / ipc / pull-chromium.py
blobe73cc345498b9b3a1f8b4ccbce404ef467f2f253
1 """
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.
9 """
11 import sys, os
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"
19 sys.exit(1)
21 if not os.path.exists(os.path.join(chromiumtree, 'src/DEPS')):
22 print >>sys.stderr, "Incorrect chromium directory, missing DEPS"
23 sys.exit(1)
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])
35 doexport('base')
36 doexport('chrome/common')
37 doexport('build/build_config.h')
38 doexport('testing/gtest/include')
39 doexport('third_party/libevent')