| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import fnmatch | 5 import fnmatch |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import pipes | 8 import pipes |
| 9 import shlex | 9 import shlex |
| 10 import shutil | 10 import shutil |
| 11 import subprocess | 11 import subprocess |
| 12 import sys | 12 import sys |
| 13 import traceback | 13 import traceback |
| 14 | 14 |
| 15 | 15 |
| 16 def CopyFile(src_file_path, dst_file_path): |
| 17 shutil.copy2(src_file_path, dst_file_path) |
| 18 |
| 19 |
| 16 def MakeDirectory(dir_path): | 20 def MakeDirectory(dir_path): |
| 17 try: | 21 try: |
| 18 os.makedirs(dir_path) | 22 os.makedirs(dir_path) |
| 19 except OSError: | 23 except OSError: |
| 20 pass | 24 pass |
| 21 | 25 |
| 22 | 26 |
| 23 def DeleteDirectory(dir_path): | 27 def DeleteDirectory(dir_path): |
| 24 if os.path.exists(dir_path): | 28 if os.path.exists(dir_path): |
| 25 shutil.rmtree(dir_path) | 29 shutil.rmtree(dir_path) |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 125 |
| 122 def IsTimeStale(output, inputs): | 126 def IsTimeStale(output, inputs): |
| 123 if not os.path.exists(output): | 127 if not os.path.exists(output): |
| 124 return True | 128 return True |
| 125 | 129 |
| 126 output_time = GetModifiedTime(output) | 130 output_time = GetModifiedTime(output) |
| 127 for input in inputs: | 131 for input in inputs: |
| 128 if GetModifiedTime(input) > output_time: | 132 if GetModifiedTime(input) > output_time: |
| 129 return True | 133 return True |
| 130 return False | 134 return False |
| OLD | NEW |