ipc/pull-chromium.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ipc/pull-chromium.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 +
     1.8 +"""
     1.9 +Pull a specified revision of chromium from SVN.
    1.10 +
    1.11 +Usage: python pull-chromium.py <topsrcdir> <chromiumtree> <revision>
    1.12 +
    1.13 +You will have to set up a Chromium tree before running this step. See
    1.14 +http://dev.chromium.org/developers/how-tos/get-the-code for details about
    1.15 +doing this efficiently.
    1.16 +"""
    1.17 +
    1.18 +import sys, os
    1.19 +from subprocess import check_call
    1.20 +from shutil import rmtree
    1.21 +
    1.22 +topsrcdir, chromiumtree, rev = sys.argv[1:]
    1.23 +
    1.24 +if not os.path.exists(os.path.join(topsrcdir, 'client.py')):
    1.25 +    print >>sys.stderr, "Incorrect topsrcdir"
    1.26 +    sys.exit(1)
    1.27 +
    1.28 +if not os.path.exists(os.path.join(chromiumtree, 'src/DEPS')):
    1.29 +    print >>sys.stderr, "Incorrect chromium directory, missing DEPS"
    1.30 +    sys.exit(1)
    1.31 +
    1.32 +check_call(['gclient', 'sync', '--force', '--revision=src@%s' % rev], cwd=chromiumtree)
    1.33 +
    1.34 +chromiumsrc = os.path.join(topsrcdir, 'ipc/chromium/src')
    1.35 +os.path.exists(chromiumsrc) and rmtree(chromiumsrc)
    1.36 +
    1.37 +def doexport(svnpath):
    1.38 +    localpath = os.path.join(chromiumsrc, svnpath)
    1.39 +    os.makedirs(os.path.dirname(localpath))
    1.40 +    check_call(['svn', 'export', '-r', 'BASE', os.path.join(chromiumtree, 'src', svnpath), localpath])
    1.41 +
    1.42 +doexport('base')
    1.43 +doexport('chrome/common')
    1.44 +doexport('build/build_config.h')
    1.45 +doexport('testing/gtest/include')
    1.46 +doexport('third_party/libevent')
    1.47 +
    1.48 +
    1.49 +

mercurial