OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Copies files to a directory.""" | 7 """Copies files to a directory.""" |
8 | 8 |
9 import itertools | 9 import itertools |
10 import optparse | 10 import optparse |
(...skipping 14 matching lines...) Expand all Loading... | |
25 return result | 25 return result |
26 | 26 |
27 def CopyFile(f, dest, deps): | 27 def CopyFile(f, dest, deps): |
28 """Copy file or directory and update deps.""" | 28 """Copy file or directory and update deps.""" |
29 if os.path.isdir(f): | 29 if os.path.isdir(f): |
30 shutil.copytree(f, os.path.join(dest, os.path.basename(f))) | 30 shutil.copytree(f, os.path.join(dest, os.path.basename(f))) |
31 deps.extend(_get_all_files(f)) | 31 deps.extend(_get_all_files(f)) |
32 else: | 32 else: |
33 shutil.copy(f, dest) | 33 shutil.copy(f, dest) |
34 deps.append(f) | 34 deps.append(f) |
35 # TODO(michaelbai): Remove when crbug.com/547235 fixed. | |
36 sys.stderr.write("CopyFile: " + f + " " + dest + "\n") | |
jbudorick
2015/10/29 13:06:14
We do not want this in the build output.
michaelbai
2015/10/29 14:56:44
Let's keep it for a while, I did see 'CopyFile' bu
jbudorick
2015/10/29 14:57:29
No. Having builds making unnecessary noise is a pr
jbudorick
2015/10/29 15:03:19
Specifically, there'd be a crbug within hours abou
michaelbai
2015/10/29 17:00:45
Removed
| |
35 | 37 |
36 def DoCopy(options, deps): | 38 def DoCopy(options, deps): |
37 """Copy files or directories given in options.files and update deps.""" | 39 """Copy files or directories given in options.files and update deps.""" |
38 files = list(itertools.chain.from_iterable(build_utils.ParseGypList(f) | 40 files = list(itertools.chain.from_iterable(build_utils.ParseGypList(f) |
39 for f in options.files)) | 41 for f in options.files)) |
40 | 42 |
41 for f in files: | 43 for f in files: |
42 if os.path.isdir(f) and not options.clear: | 44 if os.path.isdir(f) and not options.clear: |
43 print ('To avoid stale files you must use --clear when copying ' | 45 print ('To avoid stale files you must use --clear when copying ' |
44 'directories') | 46 'directories') |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 options.depfile, | 110 options.depfile, |
109 deps + build_utils.GetPythonDependencies()) | 111 deps + build_utils.GetPythonDependencies()) |
110 | 112 |
111 if options.stamp: | 113 if options.stamp: |
112 build_utils.Touch(options.stamp) | 114 build_utils.Touch(options.stamp) |
113 | 115 |
114 | 116 |
115 if __name__ == '__main__': | 117 if __name__ == '__main__': |
116 sys.exit(main(sys.argv[1:])) | 118 sys.exit(main(sys.argv[1:])) |
117 | 119 |
OLD | NEW |