Index: webkit/compositor/copyfiles.py |
diff --git a/webkit/compositor/copyfiles.py b/webkit/compositor/copyfiles.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7563102af9915da103a6ee0254e3f81ebefbb364 |
--- /dev/null |
+++ b/webkit/compositor/copyfiles.py |
@@ -0,0 +1,41 @@ |
+# Copyright (c) 2012 Google Inc. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import shutil |
+import os |
+ |
+prefixes = ["../../third_party/WebKit/Source/WebCore/platform/chromium/support", |
+ "../../third_party/WebKit/Source/WebKit/chromium/src", |
+ "../../third_party/WebKit/Source/WebCore/platform"] |
+ |
+def Copy(name): |
+ src = name |
+ dst = name |
+ fullsrc = "" |
+ for prefix in prefixes: |
+ candidate = "%s/%s" % (prefix, src) |
+ if os.path.exists(candidate): |
+ fullsrc = candidate |
+ break |
+ if fullsrc == "": |
+ print "could not find %s to copy" % name |
+ return |
+ shutil.copyfile(fullsrc, dst) |
+ print "copying from %s to %s" % (fullsrc, dst) |
+ |
+def Readfile(gypfile): |
+ cc_gyp = open(gypfile, "r") |
+ obj = eval(cc_gyp.read()) |
+ cc_gyp.close() |
+ return obj |
+ |
+def Main(): |
+ files = Readfile("compositor.gyp")['variables']['webkit_compositor_sources'] |
+ for f in files: |
+ Copy(f) |
+ |
+if __name__ == '__main__': |
+ import sys |
+ os.chdir(os.path.dirname(__file__)) |
+ sys.exit(Main()) |