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 |
11 the name of the target link. | 11 the name of the target link. |
12 | 12 |
13 Before creating any links, the old entries of the TARGET directory will be | 13 Before creating any links, the old entries of the TARGET directory will be |
14 removed. | 14 removed. |
15 | 15 |
16 Usage: | 16 Usage: |
17 python tools/make_links.py OPTIONS TARGET SOURCES... | 17 python tools/make_links.py OPTIONS TARGET SOURCES... |
18 ''' | 18 """ |
19 | 19 |
20 import optparse | 20 import optparse |
21 import os | 21 import os |
22 import shutil | 22 import shutil |
23 import subprocess | 23 import subprocess |
24 import sys | 24 import sys |
25 import utils | 25 import utils |
26 | 26 |
27 | 27 |
28 def get_options(): | 28 def get_options(): |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 source = os.path.relpath(source, start=target) | 96 source = os.path.relpath(source, start=target) |
97 exit_code = make_link(source, os.path.join(target, name), orig_source) | 97 exit_code = make_link(source, os.path.join(target, name), orig_source) |
98 if exit_code != 0: | 98 if exit_code != 0: |
99 return exit_code | 99 return exit_code |
100 create_timestamp_file(options) | 100 create_timestamp_file(options) |
101 return 0 | 101 return 0 |
102 | 102 |
103 | 103 |
104 if __name__ == '__main__': | 104 if __name__ == '__main__': |
105 sys.exit(main(sys.argv)) | 105 sys.exit(main(sys.argv)) |
OLD | NEW |