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 """Does one of the following depending on the --mode argument: | 6 """Does one of the following depending on the --mode argument: |
7 check Verifies all the inputs exist, touches the file specified with | 7 check Verifies all the inputs exist, touches the file specified with |
8 --result and exits. | 8 --result and exits. |
9 hashtable Puts a manifest file and hard links each of the inputs into the | 9 hashtable Puts a manifest file and hard links each of the inputs into the |
10 output directory. | 10 output directory. |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 metavar='FOO BAR', | 699 metavar='FOO BAR', |
700 help='Variables to process in the .isolate file, default: %default') | 700 help='Variables to process in the .isolate file, default: %default') |
701 parser.add_option( | 701 parser.add_option( |
702 '-o', '--outdir', metavar='DIR', | 702 '-o', '--outdir', metavar='DIR', |
703 help='Directory used to recreate the tree or store the hash table. ' | 703 help='Directory used to recreate the tree or store the hash table. ' |
704 'If the environment variable ISOLATE_HASH_TABLE_DIR exists, it will ' | 704 'If the environment variable ISOLATE_HASH_TABLE_DIR exists, it will ' |
705 'be used. Otherwise, for run and remap, uses a /tmp subdirectory. ' | 705 'be used. Otherwise, for run and remap, uses a /tmp subdirectory. ' |
706 'For the other modes, defaults to the directory containing --result') | 706 'For the other modes, defaults to the directory containing --result') |
707 | 707 |
708 options, args = parser.parse_args() | 708 options, args = parser.parse_args() |
709 level = [logging.ERROR, logging.INFO, logging.DEBUG][min(2, options.verbose)] | 709 levels = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG] |
710 logging.basicConfig( | 710 logging.basicConfig( |
711 level=level, | 711 level=levels[min(len(levels)-1, options.verbose)], |
712 format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s') | 712 format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s') |
713 | 713 |
714 if not options.mode: | 714 if not options.mode: |
715 parser.error('--mode is required') | 715 parser.error('--mode is required') |
716 if not options.result: | 716 if not options.result: |
717 parser.error('--result is required.') | 717 parser.error('--result is required.') |
718 | 718 |
719 if len(args) > 1: | 719 if len(args) > 1: |
720 logging.debug('%s' % sys.argv) | 720 logging.debug('%s' % sys.argv) |
721 parser.error('Use only one argument which should be a .isolate file') | 721 parser.error('Use only one argument which should be a .isolate file') |
(...skipping 21 matching lines...) Expand all Loading... |
743 result_file, | 743 result_file, |
744 input_file, | 744 input_file, |
745 options.mode, | 745 options.mode, |
746 variables, | 746 variables, |
747 out_dir, | 747 out_dir, |
748 parser.error) | 748 parser.error) |
749 | 749 |
750 | 750 |
751 if __name__ == '__main__': | 751 if __name__ == '__main__': |
752 sys.exit(main()) | 752 sys.exit(main()) |
OLD | NEW |