OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import errno | 6 import errno |
7 import hashlib | 7 import hashlib |
8 import json | 8 import json |
9 import optparse | 9 import optparse |
10 import os | 10 import os |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 Trace.verbose = True | 628 Trace.verbose = True |
629 if options.debug_mode: | 629 if options.debug_mode: |
630 DebugPrint.debug_mode = True | 630 DebugPrint.debug_mode = True |
631 | 631 |
632 if options.toolchain is not None: | 632 if options.toolchain is not None: |
633 print 'warning: option -t/--toolchain is deprecated.' | 633 print 'warning: option -t/--toolchain is deprecated.' |
634 | 634 |
635 if len(args) < 1: | 635 if len(args) < 1: |
636 raise Error('No nexe files specified. See --help for more info') | 636 raise Error('No nexe files specified. See --help for more info') |
637 | 637 |
| 638 for filename in args: |
| 639 if not os.path.exists(filename): |
| 640 raise Error('Input file not found: %s' % filename) |
| 641 if not os.path.isfile(filename): |
| 642 raise Error('Input is not a file: %s' % filename) |
| 643 |
638 canonicalized = ParseExtraFiles(options.extra_files, sys.stderr) | 644 canonicalized = ParseExtraFiles(options.extra_files, sys.stderr) |
639 if canonicalized is None: | 645 if canonicalized is None: |
640 parser.error('Bad --extra-files (-x) argument syntax') | 646 parser.error('Bad --extra-files (-x) argument syntax') |
641 | 647 |
642 remap = {} | 648 remap = {} |
643 for ren in options.name: | 649 for ren in options.name: |
644 parts = ren.split(',') | 650 parts = ren.split(',') |
645 if len(parts) != 2: | 651 if len(parts) != 2: |
646 raise Error('Expecting --name=<orig_arch.so>,<new_name.so>') | 652 raise Error('Expecting --name=<orig_arch.so>,<new_name.so>') |
647 remap[parts[0]] = parts[1] | 653 remap[parts[0]] = parts[1] |
(...skipping 29 matching lines...) Expand all Loading... |
677 return 0 | 683 return 0 |
678 | 684 |
679 | 685 |
680 # Invoke this file directly for simple testing. | 686 # Invoke this file directly for simple testing. |
681 if __name__ == '__main__': | 687 if __name__ == '__main__': |
682 try: | 688 try: |
683 rtn = main(sys.argv[1:]) | 689 rtn = main(sys.argv[1:]) |
684 except Error, e: | 690 except Error, e: |
685 sys.stderr.write('%s: %s\n' % (os.path.basename(__file__), e)) | 691 sys.stderr.write('%s: %s\n' % (os.path.basename(__file__), e)) |
686 rtn = 1 | 692 rtn = 1 |
| 693 except KeyboardInterrupt: |
| 694 sys.stderr.write('%s: interrupted\n' % os.path.basename(__file__)) |
| 695 rtn = 1 |
687 sys.exit(rtn) | 696 sys.exit(rtn) |
OLD | NEW |