diff options
author | yzshen <yzshen@chromium.org> | 2015-09-14 16:19:08 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-14 23:20:33 +0000 |
commit | 1364b175ece0ecc00939dbebfabd2586301b7bc9 (patch) | |
tree | 2dee16f8a2f20c15edddf9f1fd36d985d6a20893 | |
parent | 6e2bb1f1a489c4b3cae0ea8e7f819ae93c3f54c6 (diff) | |
download | chromium_src-1364b175ece0ecc00939dbebfabd2586301b7bc9.zip chromium_src-1364b175ece0ecc00939dbebfabd2586301b7bc9.tar.gz chromium_src-1364b175ece0ecc00939dbebfabd2586301b7bc9.tar.bz2 |
third_party/mojo: stop syncing from the Mojo repository.
This CL:
- removes the scripts for syncing and relevant comments.
- adds a note in README.chromium that it has been forked from the Mojo repo.
BUG=None
Review URL: https://codereview.chromium.org/1338793003
Cr-Commit-Position: refs/heads/master@{#348760}
-rwxr-xr-x | mojo/tools/rev_sdk.py | 101 | ||||
-rwxr-xr-x | mojo/tools/utils.py | 32 | ||||
-rw-r--r-- | third_party/mojo/OWNERS | 5 | ||||
-rw-r--r-- | third_party/mojo/README.chromium | 3 |
4 files changed, 2 insertions, 139 deletions
diff --git a/mojo/tools/rev_sdk.py b/mojo/tools/rev_sdk.py deleted file mode 100755 index fa222d8..0000000 --- a/mojo/tools/rev_sdk.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -'''Tool to roll Mojo into Chromium. See: -https://github.com/domokit/mojo/wiki/Rolling-code-between-chromium-and-mojo#mojo---chromium-updates-sdk--edk -''' - -import os -import sys -from utils import commit -from utils import chromium_root_dir -from utils import system - -sdk_prefix_in_chromium = 'third_party/mojo/src' -sdk_dirs_to_clone = [ - 'mojo/edk', - 'mojo/public', - 'nacl_bindings', -] - -sdk_dirs_to_not_clone = [ - 'mojo/public/cpp/application', - 'mojo/public/interfaces/application', - 'mojo/public/interfaces/network', - 'mojo/public/java/application', -] - -# Individual files to preserve within the target repository during roll. These -# are relative to |sdk_prefix_in_chromium| but are not maintained in the mojo -# repository. -preserved_chromium_files = [ - 'mojo/edk/DEPS', - 'mojo/public/DEPS', - 'mojo/public/c/gpu/DEPS', - 'mojo/public/platform/nacl/DEPS', - 'nacl_bindings/DEPS', -] - -# A dictionary mapping dirs to clone to their destination locations in Chromium. -dirs_to_clone = {} - -for sdk_dir in sdk_dirs_to_clone: - sdk_dir_in_chromium = os.path.join(sdk_prefix_in_chromium, sdk_dir) - dirs_to_clone[sdk_dir] = sdk_dir_in_chromium - -def rev(source_dir, chromium_dir, mojo_revision): - src_commit = system(['git', 'rev-parse', mojo_revision], - cwd=source_dir).strip() - - for input_dir, dest_dir in dirs_to_clone.iteritems(): - if os.path.exists(os.path.join(chromium_dir, dest_dir)): - print 'removing directory %s' % dest_dir - system(['git', 'rm', '-r', dest_dir], cwd=chromium_dir) - print 'cloning directory %s into %s' % (input_dir, dest_dir) - files = system(['git', 'ls-files', input_dir], cwd=source_dir) - for f in files.splitlines(): - # Don't copy presubmit files over since the code is read-only on the - # chromium side. - if os.path.basename(f) == 'PRESUBMIT.py': - continue - - exclude = False - for excluded in sdk_dirs_to_not_clone: - if f.startswith(excluded): - exclude = True - break - if exclude: - continue - - # Clone |f| into Chromium under |dest_dir| at its location relative to - # |input_dir|. - f_relpath = os.path.relpath(f, input_dir) - dest_path = os.path.join(chromium_dir, dest_dir, f_relpath) - system(['mkdir', '-p', os.path.dirname(dest_path)]) - system(['cp', os.path.join(source_dir, f), dest_path]) - os.chdir(chromium_dir) - system(['git', 'add', dest_dir], cwd=chromium_dir) - - mojo_public_dest_dir = os.path.join(sdk_prefix_in_chromium, 'mojo/public') - version_filename = os.path.join(mojo_public_dest_dir, 'VERSION') - with open(version_filename, 'w') as version_file: - version_file.write(src_commit) - system(['git', 'add', version_filename], cwd=chromium_dir) - - # Reset preserved files that were blown away. - for rel_path in preserved_chromium_files: - preserved_path = os.path.join(sdk_prefix_in_chromium, rel_path) - system(['git', 'reset', '--', preserved_path]) - system(['git', 'checkout', preserved_path]) - - commit('Update mojo sdk to rev ' + src_commit, cwd=chromium_dir) - -if len(sys.argv) < 2: - print 'usage: rev_sdk.py <mojo source dir> [<mojo revision>]' - sys.exit(1) - -# Allow override of the roll revision. -revision = sys.argv[2] if len(sys.argv) == 3 else 'origin/HEAD' -rev(sys.argv[1], chromium_root_dir, revision) diff --git a/mojo/tools/utils.py b/mojo/tools/utils.py deleted file mode 100755 index 740b363..0000000 --- a/mojo/tools/utils.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import fnmatch -import os -import subprocess - -chromium_root_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), - os.pardir, os.pardir) - -def commit(message, cwd=None): - subprocess.call(['git', 'commit', '-a', '-m', message], cwd=cwd) - -def system(command, cwd=None): - return subprocess.check_output(command, cwd=cwd) - -def find(patterns, start='.'): - for path, dirs, files in os.walk(start): - for basename in files + dirs: - if any([fnmatch.fnmatch(basename, pattern) for pattern in patterns]): - filename = os.path.join(path, basename) - yield filename - -def filter_file(path, predicate): - with open(path, 'r+') as f: - lines = f.readlines() - new_lines = [line for line in lines if predicate(line)] - f.seek(0) - f.truncate() - f.write(''.join(new_lines)) diff --git a/third_party/mojo/OWNERS b/third_party/mojo/OWNERS index e807a4f..0c5328c 100644 --- a/third_party/mojo/OWNERS +++ b/third_party/mojo/OWNERS @@ -1,8 +1,3 @@ -# The code underneath src/ is being canonically developed in the mojo -# repository; please land changes there or they will be blown away by the next -# sync. -# See https://groups.google.com/a/chromium.org/d/msg/chromium-dev/nAwEbgCrUio/73AA2fnfcpEJ -# for more details. ben@chromium.org jam@chromium.org jamesr@chromium.org diff --git a/third_party/mojo/README.chromium b/third_party/mojo/README.chromium index e912cb6..c429d21 100644 --- a/third_party/mojo/README.chromium +++ b/third_party/mojo/README.chromium @@ -12,4 +12,5 @@ plugin processes that can support multiple types of sandboxed content, such as HTML, Pepper, or NaCl. Local Modifications: -None. +This library has been forked from the Mojo repository and will be moved out of +third_party soon. |