OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 | 6 |
7 """Tool for creating symlinks from SOURCES to TARGET. | 7 """Tool for creating symlinks from SOURCES to TARGET. |
8 | 8 |
9 For each SOURCE in SOURCES create a link from SOURCE to TARGET. If a | 9 For each SOURCE in SOURCES create a link from SOURCE to TARGET. If a |
10 SOURCE ends with .../lib, the lib suffix is ignored when determining | 10 SOURCE ends with .../lib, the lib suffix is ignored when determining |
(...skipping 11 matching lines...) Expand all Loading... |
22 """ | 22 """ |
23 | 23 |
24 import optparse | 24 import optparse |
25 import os | 25 import os |
26 import shutil | 26 import shutil |
27 import subprocess | 27 import subprocess |
28 import sys | 28 import sys |
29 import utils | 29 import utils |
30 | 30 |
31 # Useful messages when we find orphaned checkouts. | 31 # Useful messages when we find orphaned checkouts. |
32 old_directories = {'package_config': | 32 old_directories = { |
33 'Please remove third_party/pkg/package_config.'} | 33 'package_config': 'Please remove third_party/pkg/package_config.', |
| 34 'analyzer_cli': 'Please remove third_party/pkg/analyzer_cli.'} |
34 | 35 |
35 def get_options(): | 36 def get_options(): |
36 result = optparse.OptionParser() | 37 result = optparse.OptionParser() |
37 result.add_option("--timestamp_file", "", | 38 result.add_option("--timestamp_file", "", |
38 help='Create a timestamp file when done creating the links.', | 39 help='Create a timestamp file when done creating the links.', |
39 default='') | 40 default='') |
40 return result.parse_args() | 41 return result.parse_args() |
41 | 42 |
42 def make_link(source, target, orig_source): | 43 def make_link(source, target, orig_source): |
43 if os.path.islink(target): | 44 if os.path.islink(target): |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 source = os.path.relpath(source, start=target) | 119 source = os.path.relpath(source, start=target) |
119 exit_code = make_link(source, os.path.join(target, name), orig_source) | 120 exit_code = make_link(source, os.path.join(target, name), orig_source) |
120 if exit_code != 0: | 121 if exit_code != 0: |
121 return exit_code | 122 return exit_code |
122 create_timestamp_file(options) | 123 create_timestamp_file(options) |
123 return 0 | 124 return 0 |
124 | 125 |
125 | 126 |
126 if __name__ == '__main__': | 127 if __name__ == '__main__': |
127 sys.exit(main(sys.argv)) | 128 sys.exit(main(sys.argv)) |
OLD | NEW |