| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 logging | 5 import logging |
| 6 import platform | 6 import platform |
| 7 import subprocess | 7 import subprocess |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 # pylint: disable=E0611 | 10 # pylint: disable=E0611 |
| 11 from hashlib import sha256 | 11 from hashlib import sha256 |
| 12 # pylint: enable=E0611 | 12 # pylint: enable=E0611 |
| 13 from os.path import basename, realpath | 13 from os.path import basename, realpath |
| 14 | 14 |
| 15 from mopy.file_hash import file_hash | 15 from mopy_internal.file_hash import file_hash |
| 16 from mopy.memoize import memoize | 16 from mopy_internal.memoize import memoize |
| 17 | 17 |
| 18 _logging = logging.getLogger() | 18 _logging = logging.getLogger() |
| 19 | 19 |
| 20 @memoize | 20 @memoize |
| 21 def _get_dependencies(filename): | 21 def _get_dependencies(filename): |
| 22 """Returns a list of filenames for files that the given file depends on.""" | 22 """Returns a list of filenames for files that the given file depends on.""" |
| 23 if platform.system() == 'Windows': | 23 if platform.system() == 'Windows': |
| 24 # There's no ldd on Windows. We can try to bundle or require depends, but | 24 # There's no ldd on Windows. We can try to bundle or require depends, but |
| 25 # given that we're not supporting component build this seems low priority. | 25 # given that we're not supporting component build this seems low priority. |
| 26 return [] | 26 return [] |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 for filename in argv[1:]: | 71 for filename in argv[1:]: |
| 72 try: | 72 try: |
| 73 print transitive_hash(filename), filename | 73 print transitive_hash(filename), filename |
| 74 except subprocess.CalledProcessError: | 74 except subprocess.CalledProcessError: |
| 75 print "ERROR", filename | 75 print "ERROR", filename |
| 76 rv = 1 | 76 rv = 1 |
| 77 return rv | 77 return rv |
| 78 | 78 |
| 79 if __name__ == '__main__': | 79 if __name__ == '__main__': |
| 80 sys.exit(main(sys.argv)) | 80 sys.exit(main(sys.argv)) |
| OLD | NEW |