Wed, 31 Dec 2014 06:55:46 +0100
Added tag TORBROWSER_REPLICA for changeset 6474c204b198
michael@0 | 1 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | |
michael@0 | 5 | """ |
michael@0 | 6 | Pull a specified revision of chromium from SVN. |
michael@0 | 7 | |
michael@0 | 8 | Usage: python pull-chromium.py <topsrcdir> <chromiumtree> <revision> |
michael@0 | 9 | |
michael@0 | 10 | You will have to set up a Chromium tree before running this step. See |
michael@0 | 11 | http://dev.chromium.org/developers/how-tos/get-the-code for details about |
michael@0 | 12 | doing this efficiently. |
michael@0 | 13 | """ |
michael@0 | 14 | |
michael@0 | 15 | import sys, os |
michael@0 | 16 | from subprocess import check_call |
michael@0 | 17 | from shutil import rmtree |
michael@0 | 18 | |
michael@0 | 19 | topsrcdir, chromiumtree, rev = sys.argv[1:] |
michael@0 | 20 | |
michael@0 | 21 | if not os.path.exists(os.path.join(topsrcdir, 'client.py')): |
michael@0 | 22 | print >>sys.stderr, "Incorrect topsrcdir" |
michael@0 | 23 | sys.exit(1) |
michael@0 | 24 | |
michael@0 | 25 | if not os.path.exists(os.path.join(chromiumtree, 'src/DEPS')): |
michael@0 | 26 | print >>sys.stderr, "Incorrect chromium directory, missing DEPS" |
michael@0 | 27 | sys.exit(1) |
michael@0 | 28 | |
michael@0 | 29 | check_call(['gclient', 'sync', '--force', '--revision=src@%s' % rev], cwd=chromiumtree) |
michael@0 | 30 | |
michael@0 | 31 | chromiumsrc = os.path.join(topsrcdir, 'ipc/chromium/src') |
michael@0 | 32 | os.path.exists(chromiumsrc) and rmtree(chromiumsrc) |
michael@0 | 33 | |
michael@0 | 34 | def doexport(svnpath): |
michael@0 | 35 | localpath = os.path.join(chromiumsrc, svnpath) |
michael@0 | 36 | os.makedirs(os.path.dirname(localpath)) |
michael@0 | 37 | check_call(['svn', 'export', '-r', 'BASE', os.path.join(chromiumtree, 'src', svnpath), localpath]) |
michael@0 | 38 | |
michael@0 | 39 | doexport('base') |
michael@0 | 40 | doexport('chrome/common') |
michael@0 | 41 | doexport('build/build_config.h') |
michael@0 | 42 | doexport('testing/gtest/include') |
michael@0 | 43 | doexport('third_party/libevent') |
michael@0 | 44 | |
michael@0 | 45 | |
michael@0 | 46 |