Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: fusl/tools/copy_libcxx_headers.py

Issue 1596483004: [fusl] Build libcxx atop fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/test/vector.cc ('k') | third_party/libcxx/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/tools/copy_libcxx_headers.py
diff --git a/fusl/tools/copy_libcxx_headers.py b/fusl/tools/copy_libcxx_headers.py
new file mode 100644
index 0000000000000000000000000000000000000000..5cf9a43e5b62f94896285755539196874ea4989f
--- /dev/null
+++ b/fusl/tools/copy_libcxx_headers.py
@@ -0,0 +1,34 @@
+# 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 os
+import shutil
+import sys
+
+
+def copytree(source_dir, target_dir):
+ """Copy a tree.
viettrungluu 2016/02/10 15:59:31 nit: 2-space indents!*#@#@$?! :(
kulakowski 2016/02/10 19:52:35 Done.
+
+ This is needed because shutil.copytree requires that |target| not
+ exist yet.
+
+ """
+
+ for file in os.listdir(source_dir):
+ source = os.path.join(source_dir, file)
+ target = os.path.join(target_dir, file)
+ if os.path.isfile(source):
viettrungluu 2016/02/10 15:59:31 Things will get sad if "foo" was a file and is cha
+ shutil.copy(source, target)
+ else:
+ copytree(source, target)
+
+
+def main():
+ source_path = sys.argv[1]
+ target_path = sys.argv[2]
+ copytree(source_path, target_path)
+
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « fusl/test/vector.cc ('k') | third_party/libcxx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698