OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
pkl (ping after 24h if needed)
2014/08/21 09:32:48
Please add docstring. This looks like something th
qsr
2014/08/21 12:10:05
Done.
| |
5 import os | |
6 import shutil | |
7 import sys | |
8 | |
9 def touch(fname): | |
10 if os.path.exists(fname): | |
11 os.utime(fname, None) | |
12 else: | |
13 open(fname, 'a').close() | |
14 | |
15 def main(): | |
16 assert len(sys.argv) >= 4 | |
17 timestamp = sys.argv[1] | |
18 lib_dir = sys.argv[2] | |
19 destination_dir = sys.argv[3] | |
20 mappings = sys.argv[4:] | |
21 | |
22 if not os.path.exists(destination_dir): | |
23 os.makedirs(destination_dir) | |
24 | |
25 for mapping in mappings: | |
26 [module, library] = mapping.split('=') | |
27 shutil.copy(os.path.join(lib_dir, library), | |
28 os.path.join(destination_dir, module)) | |
29 | |
30 touch(timestamp) | |
31 | |
32 if __name__ == '__main__': | |
33 main() | |
OLD | NEW |