-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsync_from_chromium.py
More file actions
51 lines (40 loc) · 1.25 KB
/
Copy pathsync_from_chromium.py
File metadata and controls
51 lines (40 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Copyright 2016 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 filecmp
import os
import os.path
import shutil
import sys
# Copies any files in the ports EDK repo from the chromium repo. Useful for
# syncing this repo against upstream changes.
DIRS_TO_COPY_ = [
"chrome/test/base",
"components/test",
"content/browser/mojo",
"content/child",
"content/child/mojo",
"content/common/mojo",
"mojo",
"mojo/edk/embedder",
"mojo/edk/system",
"mojo/edk/system/ports",
"mojo/edk/test",
"mojo/shell/runner/child",
"mojo/shell/runner/host",
"net/test",
]
def UpdateDir(src_path, dest_path):
for entry in os.listdir(dest_path):
src_entry = os.path.join(src_path, entry)
dest_entry = os.path.join(dest_path, entry)
if os.path.isfile(dest_entry):
shutil.copyfile(src_entry, dest_entry)
def UpdatePortsEDKOverlay(ports_root, src_root):
for dir in DIRS_TO_COPY_:
UpdateDir(os.path.join(src_root, dir), os.path.join(ports_root, dir))
if __name__ == "__main__":
if len(sys.argv) < 2:
print "Please provide the location of your chromium src."
exit(1)
exit(UpdatePortsEDKOverlay(os.path.dirname(sys.argv[0]), sys.argv[1]))